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

Add web client for DIDE portal #9

Merged
merged 6 commits into from
Feb 4, 2025
Merged

Add web client for DIDE portal #9

merged 6 commits into from
Feb 4, 2025

Conversation

richfitz
Copy link
Member

@richfitz richfitz commented Jan 30, 2025

The testing here could be expanded but as we expect this to change soon, I think we're largely ok for now. I've run a few calls against the real server while capturing the responses for testing, and the approach is almost identical to that in the R package

@richfitz richfitz marked this pull request as ready for review January 31, 2025 12:24
@richfitz richfitz requested a review from weshinsley January 31, 2025 12:25
Copy link
Contributor

@weshinsley weshinsley left a comment

Choose a reason for hiding this comment

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

Looks good to me - one question on the toml...

@@ -42,6 +44,7 @@ path = "src/hipercow/__about__.py"
dependencies = [
"pytest",
"pytest-cov",
"responses",
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be in the other batch of dependencies above (line 29ish?) - CI tests all fine, but I got "No module named 'responses'" running hatch test, so had a guess and moved it up, which sorted things for me.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is in the right place (alongside pytest - these are not dependencies of the package but of the tests. Starting from a fresh clone works for me:

rfitzjoh@wpia-dide300:~/tmp$ git clone -b mrc-6201 git@github.com:mrc-ide/hipercow-py
Cloning into 'hipercow-py'...
remote: Enumerating objects: 389, done.
remote: Counting objects: 100% (48/48), done.
remote: Compressing objects: 100% (21/21), done.
remote: Total 389 (delta 28), reused 28 (delta 23), pack-reused 341 (from 1)
Receiving objects: 100% (389/389), 66.14 KiB | 868.00 KiB/s, done.
Resolving deltas: 100% (237/237), done.
rfitzjoh@wpia-dide300:~/tmp$ cd hipercow-py/
rfitzjoh@wpia-dide300:~/tmp/hipercow-py$ hatch run test
============================= test session starts ==============================
platform linux -- Python 3.13.1, pytest-8.3.4, pluggy-1.5.0
rootdir: /home/rfitzjoh/tmp/hipercow-py
configfile: pyproject.toml
plugins: cov-6.0.0
collected 47 items                                                             

tests/dide/test_web.py ................                                  [ 34%]
tests/test_cli.py ......                                                 [ 46%]
tests/test_create.py .                                                   [ 48%]
tests/test_root.py ........                                              [ 65%]
tests/test_task.py ..........                                            [ 87%]
tests/test_task_eval.py ...                                              [ 93%]
tests/test_util.py ...                                                   [100%]

============================== 47 passed in 0.21s ==============================

"se": encode64(""), # stderr
"so": encode64(""), # stdout
"jobs": encode64(path_call),
"dep": encode64(""), # dependencies, eventually
Copy link
Contributor

Choose a reason for hiding this comment

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

To be clear - this is comma-separated job-ids that this new job will depend on (ie, wait to successfully finish, before starting), rather than any other sorts of dependencies...

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah - this is copied from the defaults in the R client but refers to dependencies among jobs/tasks not packages https://github.com/mrc-ide/hipercow/blob/main/drivers/windows/R/web.R#L249-L263

@richfitz richfitz merged commit 27a4c4b into main Feb 4, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants