Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📝 Adds rabbit ss1d example script for public-api [skip actions] #3138

Merged

Conversation

pcrespov
Copy link
Member

@pcrespov pcrespov commented Jun 24, 2022

What do these changes do?

Adds a sample script that runs the Rabbit Soltis-Saucerman model with full b-AR signalling (or "Rabbit SS 1D cardiac") from dataset 4 via the public api.

Related issue/s

How to test

  • Install packages
$ pip install osparc python-dotenv
  • Set up url, user and password to access the api endpoint in .env file (see .env-devel)
  • Run script
$ cd tests/pubic-api/examples
$ python rabbit_cardiac_ss1d.py
Entrypoint https://api.osparc-master.speag.com
Job created {'created_at': datetime.datetime(2022, 6, 24, 13, 45, 28, 114000, tzinfo=tzutc()),
 'id': '03e35f94-16e0-4861-8b3a-9e87d5f32a74',
 'inputs_checksum': 'b81d82fd92426910fc86febc362b5843ded1e9c447b508e40f6fbcf59d9f5232',
 'name': 'solvers/simcore%2Fservices%2Fcomp%2Frabbit-ss-1d-cardiac-model/releases/1.0.0/jobs/03e35f94-16e0-4861-8b3a-9e87d5f32a74',
 'outputs_url': 'http://api.osparc-master.speag.com/v0/solvers/simcore/services/comp/rabbit-ss-1d-cardiac-model/releases/1.0.0/jobs/03e35f94-16e0-4861-8b3a-9e87d5f32a74/outputs',
 'runner_name': 'solvers/simcore%2Fservices%2Fcomp%2Frabbit-ss-1d-cardiac-model/releases/1.0.0',
 'runner_url': 'http://api.osparc-master.speag.com/v0/solvers/simcore/services/comp/rabbit-ss-1d-cardiac-model/releases/1.0.0',
 'url': 'http://api.osparc-master.speag.com/v0/solvers/simcore/services/comp/rabbit-ss-1d-cardiac-model/releases/1.0.0/jobs/03e35f94-16e0-4861-8b3a-9e87d5f32a74'}
>>> Progress: 0%  [elapsed:0.04s]...

< ... >

>>> Progress: 100%  [elapsed:354.94s]...
---------------------------------------
>>> What is the status? {'job_id': '03e35f94-16e0-4861-8b3a-9e87d5f32a74',
 'progress': 100,
 'started_at': None,
 'state': 'SUCCESS',
 'stopped_at': datetime.datetime(2022, 6, 24, 13, 51, 23, 448854),
 'submitted_at': datetime.datetime(2022, 6, 24, 13, 51, 23, 448812)}
>>> output_1 = {'checksum': 'c5111b91456d4fc5d3215a21e727b2a2',
 'content_type': 'text/plain',
 'filename': 'ECGs.txt',
 'id': '23041654-8b4f-3953-8dc6-aba6c007df06'}
>>> output_2 = {'checksum': '1f636e762a19039a09ee7dbd7dd0798a',
 'content_type': 'text/plain',
 'filename': 'ap_1D.txt',
 'id': 'cbb393a8-b478-3181-96a4-e65ecd471fb7'}
>>> output_3 = {'checksum': 'fab98ef1f96e749eccc5ada76c920d32',
 'content_type': 'text/plain',
 'filename': 'cai_1D.txt',
 'id': '1ee715e1-31f4-3c97-a0b0-931bb3eb2bcf'}
>>> output_4 = {'checksum': '6f4d3414fbe8183be14c702a9311c9d4',
 'content_type': 'application/octet-stream',
 'filename': 'model_INPUT.from1D',
 'id': 'eb231a48-ce91-3702-a259-5e1185621dd0'}
---------------------------------------
---------------------------------------
>>>  23041654-8b4f-3953-8dc6-aba6c007df06
Downloaded to /tmp/tmp3hr4i7b3
Content-Type:  text/plain
Result:     26.000        0.216117
    27.000        0.009865
    28.000        0.020980
    29.000        0.016861
    30.000       
Status:  os.stat_result(st_mode=33204, st_ino=4068214, st_dev=2081, st_nlink=1, st_uid=1000, st_gid=1000, st_size=550, st_atime=1656078683, st_mtime=1656078683, st_ctime=1656078683)
---------------------------------------
>>>  cbb393a8-b478-3181-96a4-e65ecd471fb7
Downloaded to /tmp/tmpgu1c4bwj
Content-Type:  text/plain
Result: 2.600000e+01    24.073404       24.077454       24.083536       24.090840       24.099230       24.108661       24.119051       24.130284       24.1422
Status:  os.stat_result(st_mode=33204, st_ino=4068216, st_dev=2081, st_nlink=1, st_uid=1000, st_gid=1000, st_size=41575, st_atime=1656078683, st_mtime=1656078683, st_ctime=1656078683)
---------------------------------------
>>>  1ee715e1-31f4-3c97-a0b0-931bb3eb2bcf
Downloaded to /tmp/tmpfq4a3mt0
Content-Type:  text/plain
Result: 2.600000e+01    0.000143        0.000143        0.000142        0.000142        0.000141        0.000139        0.000138        0.000137        0.000136        0.0001
Status:  os.stat_result(st_mode=33204, st_ino=4068217, st_dev=2081, st_nlink=1, st_uid=1000, st_gid=1000, st_size=37475, st_atime=1656078684, st_mtime=1656078684, st_ctime=1656078684)
---------------------------------------
>>>  eb231a48-ce91-3702-a259-5e1185621dd0
Downloaded to /tmp/tmpwh6iumxs
Content-Type:  application/octet-stream
Status:  os.stat_result(st_mode=33204, st_ino=4068218, st_dev=2081, st_nlink=1, st_uid=1000, st_gid=1000, st_size=349800, st_atime=1656078684, st_mtime=1656078684, st_ctime=1656078684)
---------------------------------------
[{'checksum': '97c1e306c099367e949f916136f5f28d',
 'content_type': 'text/plain',
 'filename': 'initial_WTstates.txt',
 'id': '49b7db0b-b081-3fcc-ae5f-e25c9ec66178'}, {'checksum': 'fab98ef1f96e749eccc5ada76c920d32',
 'content_type': 'text/plain',
 'filename': 'cai_1D.txt',
 'id': 'faf6d62b-9510-3d7f-950b-5f9d3feb006f'}, {'checksum': '97c1e306c099367e949f916136f5f28d',
 'content_type': 'text/plain',
 'filename': 'initial_WTstates.txt',
 'id': '46d7f6f2-16fd-3fd7-851e-d562ec941211'}, {'checksum': '97c1e306c099367e949f916136f5f28d',
 'content_type': 'text/plain',
 'filename': 'initial_WTstates.txt',
 'id': 'eeaaac91-92d7-35ad-bee2-36d4a068a815'}, {'checksum': '6f4d3414fbe8183be14c702a9311c9d4',
 'content_type': 'application/octet-stream',
 'filename': 'model_INPUT.from1D',
 'id': '8d2a2c3a-3b48-372e-ae3b-7f0f27852b6f'}, {'checksum': '97c1e306c099367e949f916136f5f28d',
 'content_type': 'text/plain',
 'filename': 'initial_WTstates.txt',
 'id': '34c70352-122b-3005-9be8-e6690db4ee36'}, {'checksum': 'c5111b91456d4fc5d3215a21e727b2a2',
 'content_type': 'text/plain',
 'filename': 'ECGs.txt',
 'id': '64bd4bac-1d21-3562-97c4-bd4d166ba9d6'}, {'checksum': '1f636e762a19039a09ee7dbd7dd0798a',
 'content_type': 'text/plain',
 'filename': 'ap_1D.txt',
 'id': 'ed8e778e-b2c4-3b67-9488-b3f6a0105ff0'}, {'checksum': 'c5111b91456d4fc5d3215a21e727b2a2',
 'content_type': 'text/plain',
 'filename': 'ECGs.txt',
 'id': '23041654-8b4f-3953-8dc6-aba6c007df06'}, {'checksum': '97c1e306c099367e949f916136f5f28d',
 'content_type': 'text/plain',
 'filename': 'initial_WTstates.txt',
 'id': '5c41862b-bd6a-3454-9987-9b1e3c9f01c0'}, {'checksum': '6f4d3414fbe8183be14c702a9311c9d4',
 'content_type': 'application/octet-stream',
 'filename': 'model_INPUT.from1D',
 'id': 'eb231a48-ce91-3702-a259-5e1185621dd0'}, {'checksum': '1f636e762a19039a09ee7dbd7dd0798a',
 'content_type': 'text/plain',
 'filename': 'ap_1D.txt',
 'id': 'cbb393a8-b478-3181-96a4-e65ecd471fb7'}, {'checksum': '97c1e306c099367e949f916136f5f28d',
 'content_type': 'text/plain',
 'filename': 'initial_WTstates.txt',
 'id': '7d2be5d1-7545-326d-963b-380ab2d20c65'}, {'checksum': 'fab98ef1f96e749eccc5ada76c920d32',
 'content_type': 'text/plain',
 'filename': 'cai_1D.txt',
 'id': '1ee715e1-31f4-3c97-a0b0-931bb3eb2bcf'}, {'checksum': 'c5111b91456d4fc5d3215a21e727b2a2',
 'content_type': 'text/plain',
 'filename': 'ECGs.txt',
 'id': 'cb091ad0-bd24-3e6f-b232-c878d098e2bc'}, {'checksum': '1f636e762a19039a09ee7dbd7dd0798a',
 'content_type': 'text/plain',
 'filename': 'ap_1D.txt',
 'id': 'b4c3dcf6-54b0-34e8-a642-b10959021ad8'}, {'checksum': 'fab98ef1f96e749eccc5ada76c920d32',
 'content_type': 'text/plain',
 'filename': 'cai_1D.txt',
 'id': '437193b4-1c58-36ad-bbfa-bae64dee9c0e'}, {'checksum': '6f4d3414fbe8183be14c702a9311c9d4',
 'content_type': 'application/octet-stream',
 'filename': 'model_INPUT.from1D',
 'id': '0583c966-7a93-3820-8362-43ac934e9474'}]

Checklist

@pcrespov pcrespov self-assigned this Jun 24, 2022
@pcrespov pcrespov added this to the Diolkos milestone Jun 24, 2022
@pcrespov pcrespov added a:api framework api, data schemas, a:doc documentation, reporting, admin tasks labels Jun 24, 2022
@pcrespov pcrespov marked this pull request as ready for review June 24, 2022 14:00
@codecov
Copy link

codecov bot commented Jun 27, 2022

Codecov Report

Merging #3138 (6c3288c) into master (326d0e9) will increase coverage by 0.0%.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #3138   +/-   ##
======================================
  Coverage    81.1%   81.1%           
======================================
  Files         710     710           
  Lines       30621   30621           
  Branches     3948    3948           
======================================
+ Hits        24843   24850    +7     
+ Misses       4937    4930    -7     
  Partials      841     841           
Flag Coverage Δ
integrationtests 66.2% <ø> (-0.1%) ⬇️
unittests 77.5% <ø> (+<0.1%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ector_v2/modules/comp_scheduler/background_task.py 83.3% <0.0%> (-8.4%) ⬇️
...imcore_service_webserver/garbage_collector_core.py 67.4% <0.0%> (ø)
.../director/src/simcore_service_director/producer.py 62.1% <0.0%> (+0.2%) ⬆️
...imcore_service_webserver/garbage_collector_task.py 100.0% <0.0%> (+2.3%) ⬆️
...ore_service_director_v2/utils/dask_client_utils.py 82.6% <0.0%> (+4.3%) ⬆️
...rvice_datcore_adapter/utils/requests_decorators.py 78.9% <0.0%> (+10.5%) ⬆️

Copy link
Contributor

@KZzizzle KZzizzle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very nice, thanks for the example!

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.4% 0.4% Duplication

@pcrespov pcrespov changed the title Adds rabbit ss1d example script for public-api Adds rabbit ss1d example script for public-api [skip actions] Jun 28, 2022
Copy link
Collaborator

@elisabettai elisabettai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

Only thing that might not be very clear for a user is this part on the instructions on how to test:

"Set up url, user and password to access the api endpoint in .env file (see .env-devel)". I guess you meant what is nicely explained in the API doc.

@pcrespov
Copy link
Member Author

Looks great!

Only thing that might not be very clear for a user is this part on the instructions on how to test:

"Set up url, user and password to access the api endpoint in .env file (see .env-devel)". I guess you meant what is nicely explained in the API doc.

yes

@pcrespov pcrespov changed the title Adds rabbit ss1d example script for public-api [skip actions] 📝 Adds rabbit ss1d example script for public-api [skip actions] Jun 28, 2022
@pcrespov pcrespov merged commit b3d7fa3 into ITISFoundation:master Jun 28, 2022
@pcrespov pcrespov deleted the m4_5_7/map-core-example-dataset-4 branch June 28, 2022 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:api framework api, data schemas, a:doc documentation, reporting, admin tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants