Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Unify Section.__init__ and Sectionable.create_section behavior #368

Closed
mpsonntag opened this issue Mar 12, 2020 · 1 comment
Closed

Unify Section.__init__ and Sectionable.create_section behavior #368

mpsonntag opened this issue Mar 12, 2020 · 1 comment
Assignees

Comments

@mpsonntag
Copy link
Contributor

The base.Sectionable class features a create_section method that allows the creation of a new Section from a Document or a Section and sets the new Section as the child of the calling parent.

The methods' arguments currently only include name, type and oid and features a different behaviour than the Sections own __init__ method:

  • name cannot be empty ; this should be changed to empty being default and allowed
  • type is by default set to undefined; this should also be changed to empty being default and allowed
  • all other attributes one can assign via Section.__init__ should also be assignable via the create_section method with the exception of parent.

When these changes are implemented, the section_type_undefined odml validation should be refactored: the check for string undefined should be removed and the warning message rephrased, since the above described behaviour is the only occurrence of setting the Section.type to undefined.

@mpsonntag mpsonntag self-assigned this Apr 5, 2020
@mpsonntag
Copy link
Contributor Author

Section.__init__ and the Sectionable.create_section method will both by default set type="n.s.".

mpsonntag added a commit to mpsonntag/python-odml that referenced this issue Apr 5, 2020
Closes G-Node#368

Adds all Section attributes to the Sectionable.create_section
method.
@jgrewe jgrewe closed this as completed in aa73267 Apr 7, 2020
fschrader1992 pushed a commit to fschrader1992/python-odml that referenced this issue Apr 8, 2020
Closes G-Node#368

Adds all Section attributes to the Sectionable.create_section
method.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant