data_pipeline_api 0.7.7__tar.gz → 0.7.9__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,17 +1,19 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: data-pipeline-api
3
- Version: 0.7.7
3
+ Version: 0.7.9
4
4
  Summary: Python api to interact with the Fair Data Pipeline
5
5
  Home-page: https://www.fairdatapipeline.org/
6
6
  License: GNU General Public License v3.0
7
7
  Keywords: FAIR Data Pipeline,FAIR,Data Management,Provenance
8
8
  Author: Ryan J Field
9
9
  Author-email: ryan.field@glasgow.ac.uk
10
- Requires-Python: >=3.7.1,<3.11
10
+ Requires-Python: >=3.7.1,<4.0.0
11
11
  Classifier: License :: Other/Proprietary License
12
12
  Classifier: Programming Language :: Python :: 3
13
13
  Classifier: Programming Language :: Python :: 3.8
14
14
  Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
15
17
  Requires-Dist: PyYAML (>=6.0,<7.0)
16
18
  Requires-Dist: h5py (>=3.6.0,<4.0.0)
17
19
  Requires-Dist: matplotlib (>=3.5.1,<4.0.0)
@@ -156,23 +156,33 @@ def initialise(token: str, config: str, script: str) -> dict:
156
156
  _ = config_storageroot_id
157
157
  script_hash = fdp_utils.get_file_hash(script)
158
158
 
159
- # Create Script Storage Location
160
- script_storage_data = {
161
- "path": script.replace(run_metadata["write_data_store"], ""),
162
- "hash": script_hash,
163
- "public": True,
164
- "storage_root": script_storageroot_url,
165
- }
166
-
167
- script_location_response = fdp_utils.post_entry(
168
- token=token,
169
- url=registry_url,
170
- endpoint="storage_location",
171
- data=script_storage_data,
172
- api_version=api_version,
159
+ script_location_exists = fdp_utils.get_entry(
160
+ registry_url,
161
+ "storage_location",
162
+ query={
163
+ "hash": script_hash
164
+ }
173
165
  )
166
+ if script_location_exists:
167
+ script_location_url = script_location_exists[0]["url"]
168
+ else:
169
+ # Create Script Storage Location
170
+ script_storage_data = {
171
+ "path": script.replace(run_metadata["write_data_store"], ""),
172
+ "hash": script_hash,
173
+ "public": True,
174
+ "storage_root": script_storageroot_url,
175
+ }
176
+
177
+ script_location_response = fdp_utils.post_entry(
178
+ token=token,
179
+ url=registry_url,
180
+ endpoint="storage_location",
181
+ data=script_storage_data,
182
+ api_version=api_version,
183
+ )
174
184
 
175
- script_location_url = script_location_response["url"]
185
+ script_location_url = script_location_response["url"]
176
186
  script_file_type = os.path.basename(script).split(".")[-1]
177
187
 
178
188
  # TODO: Change to Batch?
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "data_pipeline_api"
3
- version = "0.7.7"
3
+ version = "0.7.9"
4
4
  description = "Python api to interact with the Fair Data Pipeline"
5
5
  authors = [
6
6
  "Ryan J Field <ryan.field@glasgow.ac.uk>",
@@ -31,7 +31,7 @@ keywords = [
31
31
  ]
32
32
 
33
33
  [tool.poetry.dependencies]
34
- python = "^3.7.1,<3.11"
34
+ python = "^3.7.1,<4.0"
35
35
  requests = "^2.27.1"
36
36
  matplotlib = "^3.5.1"
37
37
  scipy = "^1.7.3"
@@ -1,34 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- from setuptools import setup
3
-
4
- packages = \
5
- ['data_pipeline_api', 'data_pipeline_api.ext']
6
-
7
- package_data = \
8
- {'': ['*']}
9
-
10
- install_requires = \
11
- ['PyYAML>=6.0,<7.0',
12
- 'h5py>=3.6.0,<4.0.0',
13
- 'matplotlib>=3.5.1,<4.0.0',
14
- 'requests>=2.27.1,<3.0.0',
15
- 'scipy>=1.7.3,<2.0.0']
16
-
17
- setup_kwargs = {
18
- 'name': 'data-pipeline-api',
19
- 'version': '0.7.7',
20
- 'description': 'Python api to interact with the Fair Data Pipeline',
21
- 'long_description': "# pyDataPipeline\n\n[![pyDataPipeline](https://github.com/FAIRDataPipeline/pyDataPipeline/actions/workflows/pyDataPipeline.yaml/badge.svg?branch=dev)](https://github.com/FAIRDataPipeline/pyDataPipeline/actions/workflows/pyDataPipeline.yaml)\n[![codecov](https://codecov.io/gh/FAIRDataPipeline/pyDataPipeline/branch/dev/graph/badge.svg?token=Eax5AmrDxx)](https://codecov.io/gh/FAIRDataPipeline/pyDataPipeline)\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.5562602.svg)](https://doi.org/10.5281/zenodo.5562602)\n[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/5461/badge)](https://bestpractices.coreinfrastructure.org/projects/5461)\n\nWelcome to pyDataPipeline a Python api to interact with the Fair Data Pipeline.\n\nFull documention of the pyDataPipeline is avaialable at [https://www.fairdatapipeline.org/pyDataPipeline/](https://www.fairdatapipeline.org/pyDataPipeline/)\n\n## Installation\npyDataPipeline can be installed from PyPi:\n```\npip3 install data-pipeline-api\n```\n\nOr from the Repository:\n```\ngit clone https://github.com/FAIRDataPipeline/pythonFDP.git\n\ngit checkout dev\n\npip3 install -e .\n```\n**NB. PyDataPipeline requires Python3.**\n\n## Example submission_script\n\nAssume FDP_CONFIG_DIR, storage_locations and objects have been set by CLI tool\n\n```\nimport os\nimport fairdatapipeline as pipeline\n\ntoken = os.environ['FDP_LOCAL_TOKEN']\nconfig_dir = os.environ['FDP_CONFIG_DIR']\nconfig_path = os.path.join(config_dir, 'config.yaml')\nscript_path = os.path.join(config_dir, 'script.sh')\n\nhandle = pipeline.initialise(token, config_path, script_path)\n\npipeline.finalise(token, handle)\n\n```\n\n## SEIRS Model Example\n\nThe SEIRS Model Example is available at: [https://www.fairdatapipeline.org/pyDataPipeline/examples/SEIRS.html](https://www.fairdatapipeline.org/pyDataPipeline/examples/SEIRS.html)\n",
22
- 'author': 'Ryan J Field',
23
- 'author_email': 'ryan.field@glasgow.ac.uk',
24
- 'maintainer': None,
25
- 'maintainer_email': None,
26
- 'url': 'https://www.fairdatapipeline.org/',
27
- 'packages': packages,
28
- 'package_data': package_data,
29
- 'install_requires': install_requires,
30
- 'python_requires': '>=3.7.1,<3.11',
31
- }
32
-
33
-
34
- setup(**setup_kwargs)