gammasim / simtools

Tools and applications for the Simulation System of the CTA Observatory.
https://gammasim.github.io/simtools
BSD 3-Clause "New" or "Revised" License
10 stars 1 forks source link

Astropy units bugfix #1208

Closed EshitaJoshi closed 1 month ago

EshitaJoshi commented 1 month ago

This PR fixes a bug in the function .get_parameter_value_with_unit() where the units were strings (eg. "['m', 's', 'null']") instead of a list. Null entries within this list of units were not being returned as dimensionless, but were instead raising the following error: ValueError: 'cm, deg, null, null' did not parse as unit: At col 9, null is not a valid unit. If this is meant to be a custom unit, define it with 'u.def_unit'. To have it recognized inside a file reader or other code, enable it with 'u.add_enabled_units'. For details, see https://docs.astropy.org/en/latest/units/combining_and_defining.html

Changes:

Unit-testing checks for:

ctao-dpps-sonarqube[bot] commented 1 month ago

Passed

Analysis Details

0 Issues

Coverage and Duplications

Project ID: gammasim_simtools_AY_ssha9WiFxsX-2oy_w

View in SonarQube

ctao-dpps-sonarqube[bot] commented 1 month ago

Passed

Analysis Details

0 Issues

Coverage and Duplications

Project ID: gammasim_simtools_AY_ssha9WiFxsX-2oy_w

View in SonarQube