-
Notifications
You must be signed in to change notification settings - Fork 218
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
feat: add embl gems repository #1282
base: devel
Are you sure you want to change the base?
Conversation
achillesrasquinha
commented
Sep 20, 2022
- fix Add EMBL GEMs to Web IO Repository. #1281
- description of feature/fix: It would be nice to have the EMBL GEMs repository added to the Web IO repository list.
- tests added/passed
- add an entry to the next release
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of smaller changes are needed, otherwise this looks great. Thanks for the contribution!
@@ -1,4 +1,4 @@ | |||
"""Provide a concrete implementation of the BioModels repository interface.""" | |||
"""Provide a concrete implementation of the BiGG repository interface.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 😊
decoded_path = _decode_model_path(model_id) | ||
|
||
filename = f"{model_id}.xml.gz" | ||
print(self._url.join(decoded_path).join(filename)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the print or use logging instead.
load_model("BIOMD0000000633", cache=False, repositories=[biomodels]) | ||
biomodels.get_sbml.assert_called_once_with(model_id="BIOMD0000000633") | ||
|
||
def test_biomodels_access(embl_gems: Mock) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need a different name here:
def test_biomodels_access(embl_gems: Mock) -> None: | |
def test_embl_gems_access(embl_gems: Mock) -> None: |
|
||
""" | ||
load_model("Abiotrophia_defectiva_ATCC_49176", cache=False, repositories=[embl_gems]) | ||
biomodels.get_sbml.assert_called_once_with(model_id="Abiotrophia_defectiva_ATCC_49176") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
biomodels.get_sbml.assert_called_once_with(model_id="Abiotrophia_defectiva_ATCC_49176") | |
embl_gems.get_sbml.assert_called_once_with(model_id="Abiotrophia_defectiva_ATCC_49176") |
**kwargs, | ||
) -> None: | ||
""" | ||
Initialize a EMBL GEMs repository interface. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initialize a EMBL GEMs repository interface. | |
Initialize an EMBL GEMs repository interface. |
return f"{alphabet}/{directory}/{model_path}" | ||
|
||
|
||
class EMBLGems(AbstractModelRepository): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think EMBLGEMs
would also be an acceptable name, although your version is more legible.
from .abstract_model_repository import AbstractModelRepository | ||
|
||
|
||
def _decode_model_path(model_path): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make this a class method.
|
||
""" | ||
super().__init__( | ||
url="https://github.com/cdanielmachado/embl_gems/blob/master/models/", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Access the raw content directly:
url="https://github.com/cdanielmachado/embl_gems/blob/master/models/", | |
url="https://raw.githubusercontent.com/cdanielmachado/embl_gems/master/models/", |
The naming is confusing I think. Biomodels is the official GEM repository from EMBL by their own specification, so that should rather be called carveME repository or similar. And I would include a link to the publication in the docstring to give some recognition to the author. Looks great though and will be a helpful addition for sure. |