rice-solar-physics / pydrad

Python tools for setting up HYDRAD runs and parsing output
https://pydrad.readthedocs.io
MIT License
4 stars 3 forks source link

Split `_trm_data` into four properties? #168

Closed jwreep closed 2 months ago

jwreep commented 6 months ago

I was considering filling out the rest of the _trm_data property in pydrad.parse. (Currently need enthalpy fluxes.) It seems that it might make sense to split the property into one for each of the four equations being parsed.

It seems there might be a bit of awkward variable naming otherwise. For example, there's a gravity term in both the momentum and hydrogen energy equations. They could perhaps be named _trm_data.gravitational_momentum and _trm_data.gravitational_energy, but it might be more clear to have instead _momentum_trm_data.gravity and _H_energy_trm_data.gravity or similar.

Any thoughts?

wtbarnes commented 6 months ago

I'm not a huge fan of the latter option mostly because it would be inconsistent to separate data from the same file into differently named properties, but I see what you mean about the naming convention being a bit awkward. You could separate out the namespace by equation, ie something like _trm.momentum.gravity. It would be easy enough to build some simple data classes that could be built for the trm data that would do just that.

jwreep commented 6 months ago

That seems like a more reasonable solution than what I proposed.