Skip to content

Commit

Permalink
reduced errors related to styleguides
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobkolb committed Jul 6, 2017
1 parent 5c9352e commit 90e67dd
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import numpy as np


class Individual (I.Individual):
class Individual(I.Individual):
"""Individual entity type mixin implementation class."""

# standard methods:
Expand Down Expand Up @@ -79,13 +79,12 @@ def beard_growing(self, t):
)

def reproduction(self, unused_t):
"""Reproduce.
"""Reproduce.
Done if dwarf is older than 5, not dead and has enough to eat.
"""
if self.is_active \
and self.cell.eating_stock > 10\
and self.age > 5:
if (self.is_active
and self.cell.eating_stock > 10 and self.age > 5):
child = self.__class__(cell=self.cell,
age=1,
beard_length=0,
Expand Down
2 changes: 1 addition & 1 deletion pycopancore/model_components/seven_dwarfs/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# import all needed process taxon implementation classes:


class Model (I.Model):
class Model(I.Model):
"""Model mixin class."""

# mixins provided by this model component:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,17 @@ def __init__(self,
self.stock = stock
self.growth_rate = growth_rate

pass

def deactivate(self):
"""Deactivate a cell."""
# TODO: add custom code here:
pass

super().deactivate() # must be the last line

def reactivate(self):
"""Reactivate a cell."""
super().reactivate() # must be the first line
# TODO: add custom code here:
pass

# process-related methods:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def __init__(self,
super().__init__(**kwargs) # must be the first line
self.strategy = strategy

pass

def __lt__(self, other):
"""Make objects sortable."""
Expand All @@ -34,14 +33,14 @@ def __lt__(self, other):
def deactivate(self):
"""Deactivate an individual."""
# TODO: add custom code here:
pass

super().deactivate() # must be the last line

def reactivate(self):
"""Reactivate an individual."""
super().reactivate() # must be the first line
# TODO: add custom code here:
pass


# process-related methods:

Expand Down
2 changes: 1 addition & 1 deletion pycopancore/model_components/simple_extraction/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# none needed


class Model (I.Model):
class Model(I.Model):
"""Model mixin class."""

# mixins provided by this model component:
Expand Down
10 changes: 6 additions & 4 deletions pycopancore/private/_abstract_process_taxon_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,17 @@ def __init__(self):
# the repr and the str methods were removed in the master/prototype_jobst1
# Do we really don't want them anymore?
def __repr__(self):
return ('Process taxon object')
return 'Process taxon object'

def __str__(self):
return repr(self)

def set_value(self, variable, value):
assert isinstance(variable, variable.Variable), \
def set_value(self, var, value):
"""Dummy docstring"""
# TODO: missing method docstring
assert isinstance(var, variable.Variable), \
"variable must be a Variable object"
variable.set_value(self, value)
var.set_value(self, value)

def assert_valid(self):
"""Make sure all variable values are valid.
Expand Down
2 changes: 1 addition & 1 deletion pycopancore/process_types/explicit.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def __init__(self,
targets,
specification,
smoothness=0
):
):
"""Instantiate an instance of an explicit process.
Parameters
Expand Down
6 changes: 6 additions & 0 deletions pycopancore/runners/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,14 @@


class HookRegistrationError(BaseException):
"""Dummy docstring"""
# TODO: missing class docstring
pass


class HooksError(BaseException):
"""Dummy docstring"""
# TODO: missing class docstring
pass

#
Expand Down Expand Up @@ -143,6 +147,8 @@ def unregister_hook(cls, type, hook, theclass=None,

@classmethod
def execute_hooks(cls, type, model, t):
"""Dummy docstring"""
# TODO: Missing method docstring
assert type in cls.Types, "please give a type from {}.HookTypes".format(
cls.__qualname__)
if type is cls.Types.pre:
Expand Down
2 changes: 1 addition & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ norecursedirs =
format = parsable
skip = */__init__.py,setup.py,*/conf.py
linters = pylint,mccabe,pep257,pep8,pyflakes,pycodestyle,pydocstyle
ignore = D203,D213,E741,W0212,C0411,W0622,E501,E712,W0640,C0301,C0121,R0204,W0511
ignore = D203,D213,E741,W0212,C0411,W0622,E501,E712,W0640,C0301,C0121,R0204,W0511,C0112,C0330,W0702,C0326
# W0511 to ignore TODO statements


Expand Down

0 comments on commit 90e67dd

Please sign in to comment.