Skip to content

Releases: AFriemann/simple_model

modified v2 due to shared memory issues

27 Jan 22:52
35e0582
Compare
Choose a tag to compare

There was a problem with shared memory between model instances.
This should now be solved and tests were written to ensure correct behaviour.

list_type now working with v2 Model stacking

24 Jan 14:36
dfa0ece
Compare
Choose a tag to compare

For v2 Models list_type could not be used to stack Models:

@Model()
@Attribute('stacked', type=list_type(OtherModel))
class MyModel(object):
    pass

this should now be solved.

v2 draft included

20 Jan 17:20
99496f2
Compare
Choose a tag to compare

Included the new draft for version 2, take a look at README.v2.rst for examples.

from simple_models.v2 import Model, Attribute

@Model()
@Attribute('foobar', type=int)
class MyModel(object):
  pass

fixed the version mess

07 Sep 17:14
Compare
Choose a tag to compare

I sheepishly f**** up the package version. Should be fixed now :/

Can now set arbitrary Model attributes

30 Aug 13:48
Compare
Choose a tag to compare

It should now be possible to set Model attributes after initialization:

class Foo(Model):
  a = Attribute(str)

  @property
  def x(self):
    return self.__x__

  @x.setter
  def x(self, value):
    self.__x__ = value

should now work

changed Model logger

30 May 17:13
Compare
Choose a tag to compare

Changed Model logger to run as simple_model.${MODEL_NAME}.
This will allow easier control of simple_model logs, since you can now simply run

>>> import logging
>>> logging.getLogger('simple_model').setLevel(logging.WARNING)

model mutability

06 Apr 22:09
Compare
Choose a tag to compare

It is now possible to correctly modify Attributes after creating a Model instance.
To avoid that behaviour, you can set Model.mutable to False.

fixed problem with falsy attribute values

30 Mar 13:10
Compare
Choose a tag to compare
1.1.1

fixed problem where Falsy values would be dropped when parsing kwargs

disallow ignore unknown values

30 Mar 00:25
Compare
Choose a tag to compare

Can now set the class Attribute ignore_unknown in the Model to False to disallow unknown keywords. Unknowns will result in a ValueError.

helper methods moved

26 Jan 02:20
Compare
Choose a tag to compare
  • moved list_type helper class to separate file
  • added one_of function for easy value checking