Skip to content

Commit

Permalink
move biosimulations_pipeline and vcell_pipeline to python-utils
Browse files Browse the repository at this point in the history
  • Loading branch information
jcschaff committed Dec 2, 2023
1 parent 837d501 commit 57b0445
Show file tree
Hide file tree
Showing 35 changed files with 691 additions and 422 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ stdOut.txt
*.rar

# need this file for testing
!vcell-cli-utils/tests/fixtures/modeldb-206365-outputs.zip
!python-utils/tests/fixtures/modeldb-206365-outputs.zip

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ OMEX_OUTPUT_DIR=<<path-to-output-artifacts>>
```

```bash
poetry run python biosimulations_pipeline/cli.py --help
poetry run python vcutils/biosimulations_pipeline/cli.py --help
```

```
Expand All @@ -39,7 +39,7 @@ poetry run python biosimulations_pipeline/cli.py --help
## upload OMEX files

```bash
poetry run python biosimulations_pipeline/cli.py upload_omex --help
poetry run python vcutils/biosimulations_pipeline/cli.py upload_omex --help
```

```
Expand All @@ -60,7 +60,7 @@ Options:
## download runs

```bash
poetry run python biosimulations_pipeline/cli.py download_runs --help
poetry run python vcutils/biosimulations_pipeline/cli.py download_runs --help
```

```
Expand All @@ -80,7 +80,7 @@ Options:
## refresh status

```bash
poetry run python biosimulations_pipeline/cli.py refresh_status --help
poetry run python vcutils/biosimulations_pipeline/cli.py refresh_status --help
```

```
Expand All @@ -96,7 +96,7 @@ Options:
## compare runs

```bash
poetry run python biosimulations_pipeline/cli.py compare_runs --help
poetry run python vcutils/biosimulations_pipeline/cli.py compare_runs --help
```

```
Expand All @@ -114,7 +114,7 @@ Options:
## publish

```bash
poetry run python biosimulations_pipeline/cli.py publish --help
poetry run python vcutils/biosimulations_pipeline/cli.py publish --help
```

```
Expand Down
11 changes: 11 additions & 0 deletions python-utils/mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[mypy]
ignore_missing_imports = True
ignore_errors = False

[vcell_opt]
ingore_errors = False
disallow_untyped_defs = True
disallow_untyped_calls = True

;[copasi-basico]
;ignore_errors = False
620 changes: 620 additions & 0 deletions python-utils/poetry.lock

Large diffs are not rendered by default.

39 changes: 39 additions & 0 deletions python-utils/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
[tool.poetry]
name = "vcutils"
version = "0.7.2"
description = "Python general utility package for VCell"
authors = ["Virtual Cell"]
license = "MIT"
repository = "https://github.com/virtualcell/vcell"
keywords = ["HDF5", "SBML", "VCell"]
classifiers = [
'Development Status :: 3 - Alpha',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Topic :: Scientific/Engineering :: Bio-Informatics',
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3 :: Only",
]

[tool.poetry.dependencies]
python = "^3.9"
requests = "^2.31.0"
pydantic = "^2.5.2"
python-dotenv = "^1.0.0"
typer = "^0.9.0"
h5py = "^3.10.0"


[tool.poetry.dev-dependencies]
pytest = "^7.4.0"
mypy = "^1.4.1"

[tool.poetry.group.dev.dependencies]
types-requests = "^2.31.0.10"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from typing import Optional
from vcell_pipeline.citation import getCitation, CitationInfo, getSuggestedProjectName
from vcutils.vcell_pipeline.citation import getCitation, CitationInfo, getSuggestedProjectName


def test_citation() -> None:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from pathlib import Path
from biosimulations_pipeline.hdf5_compare import get_results, compare_arrays, compare_datasets
from vcutils.biosimulations_pipeline.hdf5_compare import get_results, compare_arrays, compare_datasets


def test_compare_arrays() -> None:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import json

from vcell_pipeline.vcell_datamodels import Publication
from vcutils.vcell_pipeline.vcell_datamodels import Publication

testdata = '''
[
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def run_project(

print(source_omex.omex_file)
with open(source_omex.omex_file, 'rb') as omex_file_handle:
multipart_form_data: dict[str, Union[tuple[str, BinaryIO], tuple[None, str]] = {
multipart_form_data: dict[str, Union[tuple[str, BinaryIO], tuple[None, str]]] = {
'file': (source_omex.project_id + '.omex', omex_file_handle),
'simulationRun': (None, simulation_run_request.json()),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from biosim_api import run_project, check_run_status, publish_project
from data_manager import DataManager
from datamodels import Simulator, SimulationRun, SimulatorComparison
from vcell_common.api_utils import download_file
from vcutils.vcell_common.api_utils import download_file
from hdf5_compare import compare_datasets, get_results


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from pathlib import Path
from typing import Optional

from biosimulations_pipeline.datamodels import (
from vcutils.biosimulations_pipeline.datamodels import (
BiosimulationsProject,
SourceOmex,
SimulationRun,
Expand Down
File renamed without changes.
File renamed without changes.
Empty file.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import Optional
import requests
import time
from vcell_pipeline.vcell_datamodels import Publication
from vcutils.vcell_pipeline.vcell_datamodels import Publication


class CitationInfo:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from typing import Optional

from citation import getCitation, CitationInfo, getSuggestedProjectName
from vcell_common.api_utils import download_file
from vcell_pipeline.vcell_datamodels import Publication
from vcutils.vcell_common.api_utils import download_file
from vcutils.vcell_pipeline.vcell_datamodels import Publication


class ExportStatus(BaseModel):
Expand Down Expand Up @@ -63,8 +63,8 @@ def download_published_omex(api_base_url: str, out_dir: Path) -> None:

except requests.exceptions.HTTPError as e:
error_msg = str(e)
error_response: requests.Response = e.response
if error_response.status_code == 500:
error_response: requests.Response | None = e.response
if error_response is not None and error_response.status_code >= 400:
error_msg += " "+error_response.text
print(error_msg)
exportStatus.exception = error_msg
Expand Down
Loading

0 comments on commit 57b0445

Please sign in to comment.