From 135c391522ae74886b0f6836ee28a780a776d7c5 Mon Sep 17 00:00:00 2001 From: Ryan Lyttle Date: Fri, 17 Jan 2025 14:54:29 +0000 Subject: [PATCH] Renamed auxiliary config paramter de440s to planet_ephemeris Renamed auxiliary config paramter de440s to planet_ephemeris in sorchaConfigs and updated unit tests and docs. --- docs/advanced.rst | 4 ++-- src/sorcha/utilities/sorchaConfigs.py | 24 +++++++++++++----------- tests/sorcha/test_sorchaConfigs.py | 4 ++-- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/docs/advanced.rst b/docs/advanced.rst index 3fcfa938..acf81339 100644 --- a/docs/advanced.rst +++ b/docs/advanced.rst @@ -152,8 +152,8 @@ For backwards compability and to enable new version of the files to be run as we [AUXILIARY] - de440s = de440s.bsp - de440s_url = https://naif.jpl.nasa.gov/pub/naif/generic_kernels/spk/planets/de440s.bsp + planet_ephemeris = de440s.bsp + planet_ephemeris_url = https://naif.jpl.nasa.gov/pub/naif/generic_kernels/spk/planets/de440s.bsp earth_predict = earth_200101_990827_predict.bpc earth_predict_url = https://naif.jpl.nasa.gov/pub/naif/generic_kernels/pck/earth_200101_990827_predict.bpc diff --git a/src/sorcha/utilities/sorchaConfigs.py b/src/sorcha/utilities/sorchaConfigs.py index 5b619a74..f1a7ea78 100644 --- a/src/sorcha/utilities/sorchaConfigs.py +++ b/src/sorcha/utilities/sorchaConfigs.py @@ -790,10 +790,10 @@ def _validate_expert_configs(self): class auxiliaryConfigs: """Data class for holding auxiliary section configuration file keys and validating them.""" - de440s: str = "de440s.bsp" - """filename of de440s""" - de440s_url: str = "https://naif.jpl.nasa.gov/pub/naif/generic_kernels/spk/planets/de440s.bsp" - """url for de4440s""" + planet_ephemeris: str = "de440s.bsp" + """filename of planet_ephemeris""" + planet_ephemeris_url: str = "https://naif.jpl.nasa.gov/pub/naif/generic_kernels/spk/planets/de440s.bsp" + """url for planet_ephemeris""" earth_predict: str = "earth_200101_990827_predict.bpc" """filename of earth_predict""" @@ -868,7 +868,7 @@ class auxiliaryConfigs: def default_url(self): """returns a dictionary of the default urls used in this version of sorcha""" return { - "de440s": self.__class__.de440s_url, + "planet_ephemeris": self.__class__.planet_ephemeris_url, "earth_predict": self.__class__.earth_predict_url, "earth_historical": self.__class__.earth_historical_url, "earth_high_precision": self.__class__.earth_high_precision_url, @@ -883,7 +883,7 @@ def default_url(self): def default_filenames(self): """returns a dictionary of the default filenames used in this version""" return { - "de440s": self.__class__.de440s, + "planet_ephemeris": self.__class__.planet_ephemeris, "earth_predict": self.__class__.earth_predict, "earth_historical": self.__class__.earth_historical, "earth_high_precision": self.__class__.earth_high_precision, @@ -934,7 +934,7 @@ def _create_lists_auxiliary_configs(self): """ self.urls = { - self.de440s: self.de440s_url, + self.planet_ephemeris: self.planet_ephemeris_url, self.earth_predict: self.earth_predict_url, self.earth_historical: self.earth_historical_url, self.earth_high_precision: self.earth_high_precision_url, @@ -946,7 +946,7 @@ def _create_lists_auxiliary_configs(self): } self.data_file_list = [ - self.de440s, + self.planet_ephemeris, self.earth_predict, self.earth_historical, self.earth_high_precision, @@ -960,7 +960,7 @@ def _create_lists_auxiliary_configs(self): ] self.data_files_to_download = [ - self.de440s, + self.planet_ephemeris, self.earth_predict, self.earth_historical, self.earth_high_precision, @@ -976,7 +976,7 @@ def _create_lists_auxiliary_configs(self): self.earth_historical, self.earth_predict, self.orientation_constants, - self.de440s, + self.planet_ephemeris, self.earth_high_precision, ] @@ -1487,7 +1487,9 @@ def PrintConfigsToLog(sconfigs, cmd_args): "...the orientation information and physical constants for other bodies file is: " + str(sconfigs.auxiliary.orientation_constants) ) - pplogger.info("...the Earth's position for ephemerides file is: " + str(sconfigs.auxiliary.de440s)) + pplogger.info( + "...the Earth's position for ephemerides file is: " + str(sconfigs.auxiliary.planet_ephemeris) + ) pplogger.info( "...the regularly updated specification of the Earth's orientation file is: " + str(sconfigs.auxiliary.earth_high_precision) diff --git a/tests/sorcha/test_sorchaConfigs.py b/tests/sorcha/test_sorchaConfigs.py index 7322e56d..d437f3a7 100644 --- a/tests/sorcha/test_sorchaConfigs.py +++ b/tests/sorcha/test_sorchaConfigs.py @@ -995,7 +995,7 @@ def test_expertConfig_bool(key_name): @pytest.mark.parametrize( "file", [ - "de440s", + "planet_ephemeris", "earth_predict", "earth_historical", "jpl_planets", @@ -1015,7 +1015,7 @@ def test_auxiliary_config_url_given_filename_not(file): @pytest.mark.parametrize( "file", [ - "de440s", + "planet_ephemeris", "earth_predict", "earth_historical", "jpl_planets",