Skip to content

Commit

Permalink
Save the MVS parameter csv file in data package
Browse files Browse the repository at this point in the history
  • Loading branch information
Bachibouzouk committed Oct 16, 2022
1 parent 44881d6 commit 2c785b7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
5 changes: 5 additions & 0 deletions prepare_package.py
Expand Up @@ -21,6 +21,11 @@
shutil.copytree(
os.path.join(".", pgk_data_src), os.path.join(pkg_data_folder, pkg_data_dest)
)
# Move the MVS parameters from the docs into the package_data folder
shutil.copyfile(
os.path.join(".", "docs", "MVS_parameters_list.csv"),
os.path.join(pkg_data_folder, "MVS_parameters_list.csv"),
)

# Rebuild the package
os.system("python setup.py sdist bdist_wheel")
Expand Down
22 changes: 17 additions & 5 deletions src/multi_vector_simulator/utils/__init__.py
Expand Up @@ -124,12 +124,24 @@ def get_doc_type(self, param_label):


try:
REPO_PATH = os.path.dirname(
os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
)
PARAMETERS_DOC = ParameterDocumentation(
param_info_file=os.path.join(REPO_PATH, "docs", "MVS_parameters_list.csv")
mvs_parameter_file = "MVS_parameters_list.csv"
DOC_PATH = os.path.join(
os.path.dirname(
os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
),
"docs",
)
if os.path.exists(DOC_PATH):
PARAMETERS_DOC = ParameterDocumentation(
param_info_file=os.path.join(DOC_PATH, mvs_parameter_file)
)
elif os.path.exists(PACKAGE_DATA_PATH):
PARAMETERS_DOC = ParameterDocumentation(
param_info_file=os.path.join(PACKAGE_DATA_PATH, mvs_parameter_file)
)
else:
PARAMETERS_DOC = None

except FileNotFoundError:
PARAMETERS_DOC = None

Expand Down

0 comments on commit 2c785b7

Please sign in to comment.