Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

nixpy style values and printing #313

Merged
merged 24 commits into from
Nov 23, 2018
Merged

nixpy style values and printing #313

merged 24 commits into from
Nov 23, 2018

Conversation

mpsonntag
Copy link
Contributor

This PR aims to make working with odml and the odml part of nixpy more similar and closes #308 and #309.

Updates in printing Sections and Properties

  • __repr__ of both Section and Property are now similar to the nixpy style.
  • Section.__repr__ also features the immediate child Property count next to the child Section count.
  • The nixpy style pprint methods have been added to both Section and Property.

Adding of 'Property.values' and deprecation of 'Property.value'

To make working with odML and nixpy more similar, the Property.value attribute has been marked deprecated and the Property.values attribute has been added. This is a significant change, since Property attributes are serialized to and from a file when saving / loading to any of the supported file formats.

Since I did not want any changes in the file format itself, Property.values is now mapped via the Property format to value on saving and back on loading similar to the handling of Property.dependency_value or Property.oid.

All the tests and documentation have been checked and updated, since this is quite a significant change and touches the Property format and all parsers.

@coveralls
Copy link

coveralls commented Nov 22, 2018

Coverage Status

Coverage decreased (-0.8%) to 77.232% when pulling 3c0208c on mpsonntag:nixvalues into 25330df on G-Node:master.

Copy link
Member

@jgrewe jgrewe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm,
the only thing I was wondering about is the e.g "section[0/5]" notation. On first glance it looked to me as if this indicates section number 0 of 5... which does not make sense.

I do not have a better idea, though (maybe the pipe?)

@jgrewe jgrewe merged commit ac805c5 into G-Node:master Nov 23, 2018
@mpsonntag mpsonntag deleted the nixvalues branch November 23, 2018 10:10
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Value attribute differently named in odml and nixpy
3 participants