From 9603db2364c9e68796743bb716228216b22ed213 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Mon, 11 Dec 2023 12:04:07 +0100 Subject: [PATCH 1/2] Move carbon data loading into config --- lib/galaxy/config/__init__.py | 2 +- lib/galaxy/{ => config}/carbon_emissions/__init__.py | 0 lib/galaxy/{ => config}/carbon_emissions/carbon_intensity.csv | 0 3 files changed, 1 insertion(+), 1 deletion(-) rename lib/galaxy/{ => config}/carbon_emissions/__init__.py (100%) rename lib/galaxy/{ => config}/carbon_emissions/carbon_intensity.csv (100%) diff --git a/lib/galaxy/config/__init__.py b/lib/galaxy/config/__init__.py index a3dfa347e627..a2aca000bfe8 100644 --- a/lib/galaxy/config/__init__.py +++ b/lib/galaxy/config/__init__.py @@ -33,7 +33,6 @@ import yaml -from galaxy.carbon_emissions import get_carbon_intensity_entry from galaxy.config.schema import AppSchema from galaxy.exceptions import ConfigurationError from galaxy.util import ( @@ -51,6 +50,7 @@ running_from_source, ) from galaxy.util.themes import flatten_theme +from .carbon_emissions import get_carbon_intensity_entry from ..version import ( VERSION_MAJOR, VERSION_MINOR, diff --git a/lib/galaxy/carbon_emissions/__init__.py b/lib/galaxy/config/carbon_emissions/__init__.py similarity index 100% rename from lib/galaxy/carbon_emissions/__init__.py rename to lib/galaxy/config/carbon_emissions/__init__.py diff --git a/lib/galaxy/carbon_emissions/carbon_intensity.csv b/lib/galaxy/config/carbon_emissions/carbon_intensity.csv similarity index 100% rename from lib/galaxy/carbon_emissions/carbon_intensity.csv rename to lib/galaxy/config/carbon_emissions/carbon_intensity.csv From b63da52c8b979442bc05a3f8b782a96d011ae8de Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Mon, 11 Dec 2023 15:39:29 +0100 Subject: [PATCH 2/2] Fix and move unit test --- test/unit/{ => config}/carbon_emissions/__init__.py | 0 .../carbon_emissions/test_get_carbon_intensity_entry.py | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename test/unit/{ => config}/carbon_emissions/__init__.py (100%) rename test/unit/{ => config}/carbon_emissions/test_get_carbon_intensity_entry.py (91%) diff --git a/test/unit/carbon_emissions/__init__.py b/test/unit/config/carbon_emissions/__init__.py similarity index 100% rename from test/unit/carbon_emissions/__init__.py rename to test/unit/config/carbon_emissions/__init__.py diff --git a/test/unit/carbon_emissions/test_get_carbon_intensity_entry.py b/test/unit/config/carbon_emissions/test_get_carbon_intensity_entry.py similarity index 91% rename from test/unit/carbon_emissions/test_get_carbon_intensity_entry.py rename to test/unit/config/carbon_emissions/test_get_carbon_intensity_entry.py index 0a67c37d61cf..f79d58b5676a 100644 --- a/test/unit/carbon_emissions/test_get_carbon_intensity_entry.py +++ b/test/unit/config/carbon_emissions/test_get_carbon_intensity_entry.py @@ -1,4 +1,4 @@ -from galaxy.carbon_emissions import get_carbon_intensity_entry +from galaxy.config.carbon_emissions import get_carbon_intensity_entry def test_get_carbon_intensity_entry():