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

Improve input_state by returning populated data structures #364

Merged
merged 14 commits into from
Jun 26, 2024

Conversation

jcurtis2
Copy link
Member

@jcurtis2 jcurtis2 commented Jun 15, 2024

Returning data structures rather than passing them in as arguments. This is useful for when using input_state to read input from a output files where the user has no advanced knowledge of AeroData, GasData, etc. Previously the user would have to provide some amount of minimal information to their constructors (such as a single species to AeroData as done in test_aero_data.py, etc.).

Previously you'd need some minimal information (that would actually be overwritten by input_state):

gas_data = ppmc.GasData(("SO2",))
aero_data = ppmc.AeroData(({"H2O": [1000 * si.kg / si.m**3, 1, 18e-3 * si.kg / si.mol, 0]}))
gas_state = ppmc.GasState(gas_data)
aero_state = ppmc.AeroState(aero_data, n_part, "nummass_source")

@slayoo
Copy link
Member

slayoo commented Jun 16, 2024

@jcurtis2, do we need to have these empty constructors exposed in Python? IIUC, objects constructed this way are not usable. Would it be possible instead to have these empty constructors only in C++, and expose some read-from-file factory methods returning usable Python objects?

@jcurtis2 jcurtis2 changed the title Empty(ish) constructors for data structures Improve input_state by returning populated data structures Jun 25, 2024
@slayoo
Copy link
Member

slayoo commented Jun 26, 2024

CI fails on those setups where the freshly released SciPy 1.14.0 is used, which is due to an incompatibility on PyMieScatt side caused by scipy/scipy#20278

Reported upstream: bsumlin/PyMieScatt#25

For the time being, adding a constraint on version of SciPy to the setup.py file (only for CI)

@slayoo slayoo merged commit 9856a59 into open-atmos:main Jun 26, 2024
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants