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

Use readonly morphio Morphology #979

Merged
merged 16 commits into from
May 3, 2022
Merged

Conversation

eleftherioszisis
Copy link
Contributor

@eleftherioszisis eleftherioszisis commented Feb 9, 2022

  • Use exclusively morphio's readonly Morphology
  • Morphology inheritance turned into composition
  • Direct mutation removed
  • Section booleaness removed as it is more confusing than useful

@eleftherioszisis
Copy link
Contributor Author

It looks like there is no equality defined for readonly sections:

    def test_iter_sections_default():
    
        ref = [s for n in POP.neurites for s in n.iter_sections()]
>       assert (ref ==
                              [n for n in iter_sections(POP)])
E       assert [Section(id=0...dren: 0>, ...] == [Section(id=0...dren: 0>, ...]
E         At index 0 diff: Section(id=0, type=2, n_points=11)<parent: Section(id=None), nchildren: 2> != Section(id=0, type=2, n_points=11)<parent: Section(id=None), nchildren: 2>
E         Use -v to get the full diff

tests/core/test_iter.py:103: AssertionError

@eleftherioszisis eleftherioszisis force-pushed the zisis/make-morph-readonly branch from 34cc5aa to f1396b5 Compare February 11, 2022 13:18
@eleftherioszisis eleftherioszisis changed the base branch from v4-no-morphio.mut.Morphology to v4 April 25, 2022 14:37
@codecov-commenter
Copy link

codecov-commenter commented Apr 26, 2022

Codecov Report

❗ No coverage uploaded for pull request base (v4@57b634d). Click here to learn what that means.
The diff coverage is n/a.

@@          Coverage Diff           @@
##             v4      #979   +/-   ##
======================================
  Coverage      ?   100.00%           
======================================
  Files         ?        36           
  Lines         ?      2482           
  Branches      ?         0           
======================================
  Hits          ?      2482           
  Misses        ?         0           
  Partials      ?         0           

@arnaudon
Copy link
Contributor

it's fine most of our code have neurom<4 I think :P

tox.ini Outdated Show resolved Hide resolved
neurom/core/morphology.py Outdated Show resolved Hide resolved
neurom/core/morphology.py Outdated Show resolved Hide resolved
Copy link
Member

@adrien-berchet adrien-berchet left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

Comment on lines -514 to -517
def __nonzero__(self):
"""If has root node."""
return bool(self.morphio_root_node)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mgeplf you mentioned you don't agree with removing the section booleaness. Is this still true?

Copy link
Collaborator

Choose a reason for hiding this comment

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

no; I can see how it's confusing; one can check if there are children more explicitly.

Copy link
Collaborator

@mgeplf mgeplf left a comment

Choose a reason for hiding this comment

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

LGTM

@eleftherioszisis eleftherioszisis merged commit d66d037 into v4 May 3, 2022
@eleftherioszisis eleftherioszisis deleted the zisis/make-morph-readonly branch May 3, 2022 07:59
eleftherioszisis added a commit that referenced this pull request Jun 7, 2022
Switch to using the morphio readonly morphology instead of mut

Co-authored-by: Mike Gevaert <[email protected]>
eleftherioszisis pushed a commit that referenced this pull request May 14, 2024
* Mixed subtree processing (#981)
* Refactor tests for test_mixed.py (#1027)
* Remove deprecated modules and functions/classes & warnings (#1026, #1032)
* Use readonly morphio Morphology by default (#979)
* Morphology level radial distance features use the soma as reference point (#1030)
* Expose subtree processing from the morph_stats api (#1034)
* Remove pyXX prefix for lint, docs, and coverage (#1038)
* Fix tutorials and add tutorial testenv (#1039)
* Add isort for formatting/linting (#1040)
* Add testing of example scripts (#1041)
* Make documentation/docstrings testable (#1035)
* Add black to neurom, format everything, and add to lint (#1042)
* Fix load_morpholgies to always resolve paths (#1047)
* allow Morphology objects to be either mut or immut (#1049)
* Replace iter_* methods by properties in core objects and improve iter_segments (#1054)
* Decouple Morphology constructor from io (#1120)
* Move soma methods to functions (#1118)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants