diff --git a/doc/source/releases/1.0.rst b/doc/source/releases/1.0.rst new file mode 100644 index 00000000..c9106b25 --- /dev/null +++ b/doc/source/releases/1.0.rst @@ -0,0 +1,12 @@ +================= +:mod:`nineml` 1.0 +================= + +|date| + +The first public release of the Python :mod:`nineml` package, +which corresponds to the release of version 1.0 of the +`NineML specification`_. + +.. _`NineML specification`: http://nineml-spec.readthedocs.io/ +.. |date| date:: %x \ No newline at end of file diff --git a/doc/source/releases/index.rst b/doc/source/releases/index.rst index de93759c..0d3226dd 100644 --- a/doc/source/releases/index.rst +++ b/doc/source/releases/index.rst @@ -8,3 +8,4 @@ All released NineML Python versions: :maxdepth: 1 1.0rc1 + 1.0 diff --git a/nineml/abstraction/componentclass/visitors/validators/general.py b/nineml/abstraction/componentclass/visitors/validators/general.py index 358bec0c..28739818 100644 --- a/nineml/abstraction/componentclass/visitors/validators/general.py +++ b/nineml/abstraction/componentclass/visitors/validators/general.py @@ -288,7 +288,7 @@ def _flatten_dims(self, expr, element): for arg in expr.args: dims = self._flatten_dims(arg, element) # boolean expression == 0 - if dims != 0 and dims != 1: # FIXME: allow dimless until bool params @IgnorePep8 + if dims != 0 and dims != 1: raise NineMLDimensionError(self._construct_error_message( "Logical expression provided non-boolean argument '{}'" .format(arg), dims, expr)) diff --git a/nineml/abstraction/dynamics/base.py b/nineml/abstraction/dynamics/base.py index 0d7b1b06..42947ae8 100644 --- a/nineml/abstraction/dynamics/base.py +++ b/nineml/abstraction/dynamics/base.py @@ -168,10 +168,6 @@ def __init__(self, name, parameters=(), ports=(), analog_ports=(), # Set and check event send ports match inferred if self.num_event_send_ports: - # FIXME: not all OutputEvents are necessarily exposed as Ports, - # so really we should just check that all declared output event - # ports are in the list of inferred ports, not that the declared - # list is identical to the inferred one. check_inferred_against_declared( self.event_send_port_names, inferred_struct.event_out_port_names, diff --git a/nineml/abstraction/dynamics/visitors/validators/general.py b/nineml/abstraction/dynamics/visitors/validators/general.py index a3b3ac58..d56ddce6 100644 --- a/nineml/abstraction/dynamics/visitors/validators/general.py +++ b/nineml/abstraction/dynamics/visitors/validators/general.py @@ -16,6 +16,9 @@ DimensionalityComponentValidator) from ..base import BaseDynamicsVisitor import nineml.units as un +import logging + +logger = logging.getLogger('NineML') class TimeDerivativesAreDeclaredDynamicsValidator(BaseDynamicsVisitor): @@ -119,10 +122,10 @@ def __init__(self, component_class, **kwargs): # @UnusedVariable # Recursively add all regimes connected to the first regime self._add_connected_regimes_recursive(first_regime) if len(self.connected) < len(self.regimes): - # FIXME: This should probably be a warning not an error - raise NineMLUsageError( - "Transition graph of {} contains islands: {} regimes " - "('{}') and {} connected ('{}'):\n\n{}".format( + logger.warning( + "Transition graph of {} contains islands: {} " + "regimes ('{}') and {} connected ('{}'):\n\n{}" + .format( component_class, len(self.regimes), "', '".join(r.name for r in self.regimes), diff --git a/nineml/abstraction/expressions/base.py b/nineml/abstraction/expressions/base.py index 2ff41f8e..946651f2 100644 --- a/nineml/abstraction/expressions/base.py +++ b/nineml/abstraction/expressions/base.py @@ -22,7 +22,7 @@ builtin_constants = set(['true', 'false', 'True', 'False']) builtin_functions = set([ - 'exp', 'sin', 'cos', 'log', 'log10', 'pow', 'abs', + 'exp', 'sin', 'cos', 'tan', 'log', 'log10', 'pow', 'abs', 'sinh', 'cosh', 'tanh', 'sqrt', 'mod', # 'sum', 'atan', 'asin', 'acos', 'asinh', 'acosh', 'atanh', 'atan2']) reserved_symbols = set(['t']) diff --git a/nineml/abstraction/ports.py b/nineml/abstraction/ports.py index f133a8ee..a12d0e86 100644 --- a/nineml/abstraction/ports.py +++ b/nineml/abstraction/ports.py @@ -78,7 +78,8 @@ class DimensionedPort( def __init__(self, name, dimension=None): super(DimensionedPort, self).__init__(name) - self._dimension = dimension if dimension is not None else dimensionless # TODO: This needs checking @IgnorePep8 + self._dimension = (dimension if dimension is not None + else dimensionless) @property def dimension(self): @@ -115,7 +116,7 @@ class SendPort(SendPortBase): Base class for sending ports """ - mode = "send" # FIXME: This is here for legacy unittest I think (TGC 1/15) + mode = "send" def is_incoming(self): return False @@ -129,7 +130,7 @@ class ReceivePort(object): Base class for receiving ports """ - mode = "recv" # FIXME: This is here for legacy unittest I think (TGC 1/15) + mode = "receive" def is_incoming(self): return True diff --git a/test/unittests/abstraction_test/dynamics_test.py b/test/unittests/abstraction_test/dynamics_test.py index c34043eb..29ab6cfc 100644 --- a/test/unittests/abstraction_test/dynamics_test.py +++ b/test/unittests/abstraction_test/dynamics_test.py @@ -163,7 +163,7 @@ def test_analog_ports(self): c = Dynamics(name='C1', analog_ports=[AnalogReceivePort('B')]) self.assertEqual(len(list(c.analog_ports)), 1) - self.assertEqual(list(c.analog_ports)[0].mode, 'recv') + self.assertEqual(list(c.analog_ports)[0].mode, 'receive') self.assertEqual(len(list(c.analog_send_ports)), 0) self.assertEqual(len(list(c.analog_receive_ports)), 1) self.assertEqual(len(list(c.analog_reduce_ports)), 0) diff --git a/test/unittests/units_test.py b/test/unittests/units_test.py index 79d440f8..af673cdc 100644 --- a/test/unittests/units_test.py +++ b/test/unittests/units_test.py @@ -34,8 +34,7 @@ def test_accessors(self): self.assertEqual(getattr(dim, abbrev), dim._dims[i]) self.assertEqual(getattr(dim, name), dim._dims[i]) -# FIXME: Currently the 'scale' attribute isn't supported, need to work out -# whether we want to do this or not. + units_xml_str = """ @@ -74,11 +73,6 @@ def test_accessors(self): -