Skip to content

Commit

Permalink
updated and added ci
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexPatrie committed Jul 31, 2024
1 parent 4dedac7 commit 3ce94c0
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 6 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Continuous Integration on Push

on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pytest
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ assets/.env_dev
.bio-check.json
bucket.sh
.env_dev
NOTES
NOTES
cd.yaml
12 changes: 12 additions & 0 deletions assets/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@
# BUCKET_URL = "gs://bio-check-requests-1/"


def increment_version(version: str, increment_position: int):
"""Args:
version (str): version to increment by
increment_position (int): position to increment by: 0 for major 1 for minor and 2 for patch
"""
parts = [int(n) for n in version.split(".")]
new_part = parts[increment_position] + 1
parts.remove(parts[increment_position])
parts.insert(increment_position, new_part)
return ".".join([str(n) for n in parts])


def refresh_jobs(conn):
def refresh_collection(conn, coll):
for job in conn.db[coll].find():
Expand Down
55 changes: 50 additions & 5 deletions bio_check/demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -150,16 +150,61 @@
],
"execution_count": 7
},
{
"metadata": {
"ExecuteTime": {
"end_time": "2024-07-31T15:39:26.558140Z",
"start_time": "2024-07-31T15:39:26.554661Z"
}
},
"cell_type": "code",
"source": [
"def increment_version(version: str, increment_position: int):\n",
" \"\"\"Args:\n",
" version (str): version to increment by\n",
" increment_position (int): position to increment by: 0 for major 1 for minor and 2 for patch\n",
" \"\"\"\n",
" parts = [int(n) for n in version.split(\".\")]\n",
" new_part = parts[increment_position] + 1\n",
" parts.remove(parts[increment_position])\n",
" parts.insert(increment_position, new_part)\n",
" return \".\".join([str(n) for n in parts])"
],
"id": "6351bd4f5ab6e866",
"outputs": [],
"execution_count": 10
},
{
"metadata": {
"ExecuteTime": {
"end_time": "2024-07-31T15:39:35.235735Z",
"start_time": "2024-07-31T15:39:35.231888Z"
}
},
"cell_type": "code",
"source": "increment_version('1.1.0', 1)",
"id": "3689a8ffa9d4c123",
"outputs": [
{
"data": {
"text/plain": [
"'1.2.0'"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"execution_count": 12
},
{
"metadata": {},
"cell_type": "code",
"outputs": [],
"execution_count": null,
"source": [
"from main import db_connector as conn \n",
"conn.pending_jobs()"
],
"id": "6351bd4f5ab6e866"
"source": "",
"id": "c9fc32addb37cd52"
}
],
"metadata": {
Expand Down
1 change: 1 addition & 0 deletions bio_check/verifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ def verify_sbml(
'rTol': str(rTol),
'aTol': str(aTol)
}

if selection_list:
encoder_fields['selection_list'] = ','.join(selection_list)
multidata = MultipartEncoder(fields=encoder_fields)
Expand Down
5 changes: 5 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
requests-toolbelt~=1.0.0
seaborn~=0.13.2
pydantic~=2.8.2
numpy
pandas

0 comments on commit 3ce94c0

Please sign in to comment.