Skip to content

Commit

Permalink
fix pydocstyle
Browse files Browse the repository at this point in the history
  • Loading branch information
yannikschaelte committed Mar 12, 2021
1 parent c2d5bb6 commit 2d971ec
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""yaml2sbml tests."""
10 changes: 5 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ envlist =
[testenv]
# Dependencies
deps =
coverage
pytest
pytest-cov
pytest-console-scripts
coverage >= 5.5
pytest >= 6.2.2
pytest-cov >= 2.11.1
pytest-console-scripts >= 1.1.0

# Sub-environments
# inherit settings defined in the base
Expand Down Expand Up @@ -54,7 +54,7 @@ commands =
flake8 yaml2sbml tests setup.py
pydocstyle yaml2sbml tests setup.py
description =
Run flake8 with various plugins
Run flake8 with various plugins, and pydocstyle

[testenv:unittests]
commands =
Expand Down
4 changes: 4 additions & 0 deletions yaml2sbml/YamlModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,16 +181,20 @@ def _get_reduced_model_dict(self) -> dict:

# functionalities regarding the time
def is_set_time(self):
"""Check whether there is a time variable."""
return 'variable' in self._yaml_model['time'].keys()

def set_time(self,
time_variable: str):
"""Set time variable."""
self._yaml_model['time'] = {'variable': time_variable}

def delete_time(self):
"""Delete time variable."""
self._yaml_model['time'] = {}

def get_time(self):
"""Get time variable."""
if self.is_set_time():
return self._yaml_model['time']['variable']
else:
Expand Down
2 changes: 2 additions & 0 deletions yaml2sbml/version.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
"""yaml2sbml version."""

__version__ = '0.2.1'
1 change: 0 additions & 1 deletion yaml2sbml/yaml2sbml.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ def _create_time(model: sbml.Model, time_var: str):
model: the SBML model to which the species will be added.
time_var: str, the time variable
"""

if time_var == 'time':
return

Expand Down

0 comments on commit 2d971ec

Please sign in to comment.