From d76d3c5e4a0a3409bed7eb91a3339f832abd4a87 Mon Sep 17 00:00:00 2001 From: Arjan Draisma Date: Fri, 1 Nov 2024 10:01:35 +0100 Subject: [PATCH 1/2] revert location of config for now --- config.yml => big_scape/config.yml | 0 big_scape/paths.py | 8 ++++---- pyproject.toml | 4 ++++ 3 files changed, 8 insertions(+), 4 deletions(-) rename config.yml => big_scape/config.yml (100%) diff --git a/config.yml b/big_scape/config.yml similarity index 100% rename from config.yml rename to big_scape/config.yml diff --git a/big_scape/paths.py b/big_scape/paths.py index 5b6ffa28..b4a250fa 100644 --- a/big_scape/paths.py +++ b/big_scape/paths.py @@ -2,8 +2,8 @@ import pkg_resources -DB_SCHEMA_FILE = pkg_resources.resource_filename( - "bigscape", "big_scape/data/schema.sql" -) -TEMPLATES_OUTPUT_DIR = pkg_resources.resource_filename("bigscape", "big_scape/output") +DB_SCHEMA_FILE = pkg_resources.resource_filename("bigscape", "data/schema.sql") +TEMPLATES_OUTPUT_DIR = pkg_resources.resource_filename("bigscape", "output") +# config is in base directory, not in module +# get path to package directory DEFAULT_CONFIG_FILE = pkg_resources.resource_filename("bigscape", "config.yml") diff --git a/pyproject.toml b/pyproject.toml index df5f112a..7be727eb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,6 +45,10 @@ dev = [ "Repository" = "https://github.com/medema-group/BiG-SCAPE" # TODO: documentation +[tool.setuptools.package-data] +'big_scape' = ['config.yml'] +'data' = ['data/schema.sql'] + [build-system] requires = ["hatchling"] build-backend = "hatchling.build" From 9a0275822079f0ee5a3aa67581abd06d803c6d98 Mon Sep 17 00:00:00 2001 From: Arjan Draisma Date: Fri, 1 Nov 2024 10:23:28 +0100 Subject: [PATCH 2/2] re-add underscores. none of this makes sense --- big_scape/paths.py | 6 +++--- test/integration/test_comparison.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/big_scape/paths.py b/big_scape/paths.py index b4a250fa..14ab1d11 100644 --- a/big_scape/paths.py +++ b/big_scape/paths.py @@ -2,8 +2,8 @@ import pkg_resources -DB_SCHEMA_FILE = pkg_resources.resource_filename("bigscape", "data/schema.sql") -TEMPLATES_OUTPUT_DIR = pkg_resources.resource_filename("bigscape", "output") +DB_SCHEMA_FILE = pkg_resources.resource_filename("big_scape", "data/schema.sql") +TEMPLATES_OUTPUT_DIR = pkg_resources.resource_filename("big_scape", "output") # config is in base directory, not in module # get path to package directory -DEFAULT_CONFIG_FILE = pkg_resources.resource_filename("bigscape", "config.yml") +DEFAULT_CONFIG_FILE = pkg_resources.resource_filename("big_scape", "config.yml") diff --git a/test/integration/test_comparison.py b/test/integration/test_comparison.py index 407daa3c..4f915c9a 100644 --- a/test/integration/test_comparison.py +++ b/test/integration/test_comparison.py @@ -456,7 +456,7 @@ def test_calculate_scores_pair(self): "legacy_weights": True, "record_type": bs_enums.RECORD_TYPE.REGION, "cores": 1, - "config_file_path": Path("config.yml"), + "config_file_path": Path("big_scape/config.yml"), } gbks_with_hsp = [