Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Be less strict about the unit specification in equations #323

Open
mstimberg opened this issue Sep 22, 2014 · 0 comments
Open

Be less strict about the unit specification in equations #323

mstimberg opened this issue Sep 22, 2014 · 0 comments

Comments

@mstimberg
Copy link
Member

Currently, we are very strict in the unit part of an equation leading to unnecessary error messages and making things especially complicated when creating equation strings in some automatic way:

>>> Equations('x : 1/metre')
Traceback (most recent call last):
...
ValueError: "1/metre" does not evaluate to a unit but to a quantity -- make sure to only use units, e.g. "siemens/metre**2" and not "1 * siemens/metre**2"

>>> Equations('x : amp/metre**2')
<Equations object consisting of 1 equations>
>>> Equations('x : amp/(metre**2)')
Traceback (most recent call last):
...
EquationError: Parsing failed: 
x : amp/(metre**2)
        ^
Expected end of text (at char 8), (line:1, col:9)

Should probably be handled in a more general overhaul of the parsing system that also takes care of #308.

@mstimberg mstimberg self-assigned this Sep 22, 2014
@mstimberg mstimberg modified the milestone: 2.0beta Oct 1, 2014
@mstimberg mstimberg modified the milestones: 2.0beta, 2.0beta2 Oct 8, 2014
@mstimberg mstimberg modified the milestones: 2.0beta3, 2.0beta2 Feb 2, 2015
@mstimberg mstimberg modified the milestones: 2.0beta3, 2.0beta4 Apr 30, 2015
@thesamovar thesamovar modified the milestones: 2.0beta4, 2.0 Jul 21, 2015
mstimberg added a commit that referenced this issue Feb 18, 2016
…nd not a `Quantity`)

This means that e.g. `1/second` can be used for the unit definition in equations. Addresses a part of #323
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants