Skip to content

Commit

Permalink
Fix units of N after norm
Browse files Browse the repository at this point in the history
  • Loading branch information
bgyori committed Jul 12, 2023
1 parent 58ee953 commit bf859b7
Show file tree
Hide file tree
Showing 3 changed files with 189 additions and 31 deletions.
2 changes: 2 additions & 0 deletions mira/metamodel/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,8 @@ def counts_to_dimensionless(tm: TemplateModel,
if p.units:
(coeff, exponent) = \
p.units.expression.args[0].as_coeff_exponent(counts_unit_symbol)
if isinstance(exponent, sympy.core.numbers.One):
exponent = 1
if exponent:
p.units.expression = \
SympyExprStr(p.units.expression.args[0] /
Expand Down
Loading

0 comments on commit bf859b7

Please sign in to comment.