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

Allow URL as filenames for YAML files and SBML models (Closes #187) #459

Merged
merged 2 commits into from
Aug 6, 2020

Conversation

dweindl
Copy link
Member

@dweindl dweindl commented Aug 5, 2020

No description provided.

@dweindl dweindl requested a review from yannikschaelte August 5, 2020 18:13
@codecov
Copy link

codecov bot commented Aug 5, 2020

Codecov Report

Merging #459 into develop will increase coverage by 0.09%.
The diff coverage is 93.54%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #459      +/-   ##
===========================================
+ Coverage    78.02%   78.11%   +0.09%     
===========================================
  Files           22       22              
  Lines         2225     2244      +19     
  Branches       531      536       +5     
===========================================
+ Hits          1736     1753      +17     
- Misses         363      364       +1     
- Partials       126      127       +1     
Impacted Files Coverage Δ
petab/sbml.py 56.83% <90.00%> (+5.16%) ⬆️
petab/problem.py 71.36% <100.00%> (-0.50%) ⬇️
petab/yaml.py 90.76% <100.00%> (+0.60%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c920361...3572e0a. Read the comment docs.

else:
buffer = ''.join(line for line in buffer)

# URL or already opened file, we will load the model from a string
Copy link
Member

Choose a reason for hiding this comment

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

how do you know the file is opened already?

Copy link
Member Author

Choose a reason for hiding this comment

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

From if is_file_like(filepath_or_buffer) or is_url(filepath_or_buffer): above. the former checks exactly that.

Copy link
Member Author

Choose a reason for hiding this comment

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

(and the latter would return a generator yielding the remote file content)

yaml_url = "https://raw.githubusercontent.com/PEtab-dev/petab_test_suite" \
"/master/cases/0001/_0001.yaml"
petab_problem = petab.Problem.from_yaml(yaml_url)

Copy link
Member

Choose a reason for hiding this comment

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

can e.g. also check nr of data / parameters, ... to see it is actually what is expected

Copy link
Member Author

Choose a reason for hiding this comment

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

Can, but I wouldn't find it too helpful. What would be a realistic scenario that would be covered by that? Keep it simple? :)

@dweindl dweindl merged commit 8594f3d into develop Aug 6, 2020
@dweindl dweindl deleted the feature_187_remote_files branch August 6, 2020 13:03
dweindl added a commit that referenced this pull request Sep 21, 2020
Release 0.1.9

Library:

* Allow URL as filenames for YAML files and SBML models (Closes #187) (#459)
* Allow model time in observable formulas (#445)
* Make float parsing from CSV round-trip (#444)
* Validator: Error message for missing IDs, with line numbers. (#467)
* Validator: Detect duplicated observable IDs (#446)
* Some documentation and CI fixes / updates
* Visualization: Add option to save visualization specification (#457)
* Visualization: Column XValue not mandatory anymore (#429)
* Visualization: Add sorting of indices of dataframes for the correct sorting
  of x-values (#430)
* Visualization: Default value for the column x_label in vis_spec (#431)
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