-
Notifications
You must be signed in to change notification settings - Fork 35
Description
Hello,
As a developer for infrared spectroscopy software, I really like to work with the functionality that HITRAN offers (Perkin Elmer even built a patent with it for water vapour and CO2-correction of IR-spectra), but from time to time one has to look into the code which tries to summarize everything in a single .py-file (global constants, data-specific definitions, calculation routines, a 10 minutes Python tutorial). This fact makes it hard to understand/maintain and also increases the likelihood of errors a lot (there are still a some Pull requests and issues open regarding thins).
Before tackling the issues, I think a first step could be a version 2.0 that actually makes more use of Python built-in functionalities like
- using of Python conventions for global constans (
UPPER_CASE_CONSTANT) - making more use of
Enums anddataclasses (or evenpydanticmodels) rather than relying on global-constants-dict-combinations which are hard to track back in scope - not checking types with
type(var) == some_typebut rather withisinstance - splitting the package up into modules like (
modelsfor the global constants and data models involved,database_iofor reading from the database,datafor the hard-coded data in the module,lineshapesfor the computation of lineshapes,environmentfor the environment specification part,miscfor something like the tutorial ..., just a first example structure I could think of)
Besides, the code contains some parts that could be improved
- black formatting
- linting (ruff) which would uncover something like Basic coding errors in HAPI.py: calculate_parameter_NuVC #37 like a charm
- adding type hints
these 3 steps would not require a lot of effort, but make the code so much more joy to read and maintain - not using Python-loops in heavy-duty numerics, e.g., switching to
numba,cython, or evenrustwith multiprocessing/threading could reduce the computation time quite a bit (this is currently a limiting factor for me) - in some parts
scipycould also be beneficial as dependency that most developers in that field have installed anyway - adding automated tests with
pytest(how is the module currently tested for correctness?) that could then be run whenever somebody makes a push or pull request - ...
Then, it would be way easier to incorporate the changes required to resolve open issues/pull requests in less time.
Please don't see this as criticism, I would like to join as a contributor to this package and help 😄
However, I see a lot of open issues and pull requests and therefore wanted to ask if the project is still active and if there is interest in such big changes.
Thanks for your time.