From 48f682312a8ddf70d8612964b2e86689beee0260 Mon Sep 17 00:00:00 2001 From: Penny How Date: Wed, 19 Jun 2024 10:41:27 -0100 Subject: [PATCH] ressources renamed to resources (#261) --- MANIFEST.in | 1 + setup.py | 1 - src/pypromice/process/join_l3.py | 2 +- src/pypromice/process/load.py | 6 +++--- src/pypromice/{ressources => resources}/__init__.py | 0 src/pypromice/{ressources => resources}/file_attributes.csv | 0 .../{ressources => resources}/variable_aliases_GC-Net.csv | 0 src/pypromice/{ressources => resources}/variables.csv | 0 8 files changed, 5 insertions(+), 5 deletions(-) rename src/pypromice/{ressources => resources}/__init__.py (100%) rename src/pypromice/{ressources => resources}/file_attributes.csv (100%) rename src/pypromice/{ressources => resources}/variable_aliases_GC-Net.csv (100%) rename src/pypromice/{ressources => resources}/variables.csv (100%) diff --git a/MANIFEST.in b/MANIFEST.in index 4c48bf4e..08bdee57 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1 +1,2 @@ include src/pypromice/test/* +include src/pypromice/resources/* diff --git a/setup.py b/setup.py index a7c3fc3d..835a6b84 100644 --- a/setup.py +++ b/setup.py @@ -31,7 +31,6 @@ packages=setuptools.find_packages(where="src"), python_requires=">=3.8", package_data={ - "pypromice.ressources": ["variables.csv", "file_attributes.csv", "variable_aliases_GC-Net.csv"], "pypromice.tx": ["payload_formats.csv", "payload_types.csv"], "pypromice.qc.percentiles": ["thresholds.csv"], "pypromice.postprocess": ["station_configurations.toml", "positions_seed.csv"], diff --git a/src/pypromice/process/join_l3.py b/src/pypromice/process/join_l3.py index 5c10606d..1f603621 100644 --- a/src/pypromice/process/join_l3.py +++ b/src/pypromice/process/join_l3.py @@ -92,7 +92,7 @@ def readNead(infile): ds.attrs = meta # renaming variables - file_path = pkg_resources.resource_stream('pypromice', 'ressources/variable_aliases_GC-Net.csv') + file_path = pkg_resources.resource_stream('pypromice', 'resources/variable_aliases_GC-Net.csv') var_name = pd.read_csv(file_path) var_name = var_name.set_index('old_name').GEUS_name msk = [v for v in var_name.index if v in ds.data_vars] diff --git a/src/pypromice/process/load.py b/src/pypromice/process/load.py index a2334096..97b52375 100644 --- a/src/pypromice/process/load.py +++ b/src/pypromice/process/load.py @@ -137,7 +137,7 @@ def getVars(v_file=None): Variables dataframe ''' if v_file is None: - with pkg_resources.resource_stream('pypromice', 'ressources/variables.csv') as stream: + with pkg_resources.resource_stream('pypromice', 'resources/variables.csv') as stream: return pd.read_csv(stream, index_col=0, comment="#", encoding='utf-8') else: return pd.read_csv(v_file, index_col=0, comment="#") @@ -160,7 +160,7 @@ def getMeta(m_file=None, delimiter=','): ''' meta={} if m_file is None: - with pkg_resources.resource_stream('pypromice', 'ressources/file_attributes.csv') as stream: + with pkg_resources.resource_stream('pypromice', 'resources/file_attributes.csv') as stream: lines = stream.read().decode("utf-8") lines = lines.split("\n") else: @@ -171,4 +171,4 @@ def getMeta(m_file=None, delimiter=','): meta[l.split(',')[0]] = l.split(delimiter)[1].split('\n')[0].replace(';',',') except IndexError: pass - return meta \ No newline at end of file + return meta diff --git a/src/pypromice/ressources/__init__.py b/src/pypromice/resources/__init__.py similarity index 100% rename from src/pypromice/ressources/__init__.py rename to src/pypromice/resources/__init__.py diff --git a/src/pypromice/ressources/file_attributes.csv b/src/pypromice/resources/file_attributes.csv similarity index 100% rename from src/pypromice/ressources/file_attributes.csv rename to src/pypromice/resources/file_attributes.csv diff --git a/src/pypromice/ressources/variable_aliases_GC-Net.csv b/src/pypromice/resources/variable_aliases_GC-Net.csv similarity index 100% rename from src/pypromice/ressources/variable_aliases_GC-Net.csv rename to src/pypromice/resources/variable_aliases_GC-Net.csv diff --git a/src/pypromice/ressources/variables.csv b/src/pypromice/resources/variables.csv similarity index 100% rename from src/pypromice/ressources/variables.csv rename to src/pypromice/resources/variables.csv