prashjet / popkinmocks

Create mock IFU datacubes for stellar population and kinematic modelling.
https://popkinmocks.readthedocs.io/
MIT License
4 stars 1 forks source link

decorators to validate all input strings #42

Open prashjet opened 1 year ago

prashjet commented 1 year ago

e.g. to remove the duplicated code

            str = f'Unknown variable {which_variable}'
            str += ': must be one of x1, x2, t, z, v'
            raise ValueError(f'Unknown variable: {which_variable}')

in cube methods get_variable_values, get_variable_values etc

and another to validate distribution string e.g. checking they are in alphabetical order on LHS and rhs of _