Comments (5)
Interesting, I think SymPy's Integer class might have changed:
>>> type(react['H2'])
sympy.core.numbers.Integer
or it has always been broken, I'm not sure. Either way there's plenty of things to improve on here (PRs most welcome).
But the short term work around is to perform no checks when creating Reaction
:
>>> print(chempy.chemistry.Reaction(dict(react), dict(prod), checks=()))
2 H2 + O2 -> 2 H2O
or selective disable the "all_integral" check:
>>> print(chempy.chemistry.Reaction(dict(react), dict(prod), dont_check={"all_integral"}))
2 H2 + O2 -> 2 H2O
from chempy.
Interesting, I think SymPy's Integer class might have changed:
>>> type(react['H2']) sympy.core.numbers.Integeror it has always been broken, I'm not sure. Either way there's plenty of things to improve on here (PRs most welcome).
But the short term work around is to perform no checks when creating
Reaction
:>>> print(chempy.chemistry.Reaction(dict(react), dict(prod), checks=())) 2 H2 + O2 -> 2 H2Oor selective disable the "all_integral" check:
>>> print(chempy.chemistry.Reaction(dict(react), dict(prod), dont_check={"all_integral"})) 2 H2 + O2 -> 2 H2O
Thank you so much, I'm gonna work on a pull to help you soon as can. I meantime this seem work fine.
from chempy.
No stress! I reported the change in behavior in sympy/sympy#24268 too.
from chempy.
Could we just change chempy/chemistry.py#L577
from
if v != type(v)(int(v)):
to
if v != int(v) and v != type(v)(int(v)):
It does work.
from chempy.
Sounds promising! would you mind opening a pull request?
from chempy.
Related Issues (20)
- Equilibrium root fails with water & co2-hydrolysis test
- Interest in chemical group theory component? HOT 3
- 7 tests fail on FreeBSD HOT 2
- Could this package be used to solve steam reforming problems?
- Interpreting malformed chemical formulas as substances HOT 32
- Suggestion: Funding coding or documentation through Google Summer of Code or Season of Docs HOT 1
- Please fill out SymPy documentation theme survey
- Test ChemPy with SymPy 1.10rc2 HOT 1
- Update README for improved chemical formula parser HOT 8
- New release? HOT 1
- Issue with Balancing Reactions (from examples) HOT 3
- FYI: ChemPy mentioned in Talk Python to Me podcast HOT 1
- Balancing reactions with non-integer stoichiometry HOT 1
- Two pytests are failing in our GitHub Action HOT 3
- Chempy documentation issues HOT 4
- Installation Errors HOT 2
- 5 tests fail HOT 2
- Zn(NO3)2.6H2O fails to parse in 0.8.3, regression? HOT 9
- New numpy error on import HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chempy.