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

Template morphology glialcell #256

Open
wants to merge 26 commits into
base: master
Choose a base branch
from

Conversation

jacquemi-bbp
Copy link
Collaborator

@jacquemi-bbp jacquemi-bbp commented Mar 17, 2021

This PR is the first one of a series that will implement Dendritic spine Specifications for morphio h5 format. We (@wizmer and @jacquemi-bbp ) decided to not produce too large PULL REQUEST to facilitate the work of reviewers

This PR templatizes immutable Morphology.
The mutable Morphology will be templatized in a next PR
Spine Class will be only implemented in a next next PR

Immutable Morphology becomes a TTree template class:
Two TTree instantiation are created:

  • template class TTree<NodeCellFamily::NEURON, Morphology, mut::Morphology> (for neuron)
  • template class TTree<NodeCellFamily::GLIA, GlialCell, mut::GlialCell> (for glail cell)

Immutable Section becomes Node template class:
Two Node instantiation are created:

  • template class NodeCellFamily::NEURON (Neuronal section)
  • template class NodeCellFamily::GLIA ( Glial section)

enum CellFamily replaced by struct CellFamily (that contains static constexpr to identify Cell type)

@jacquemi-bbp jacquemi-bbp marked this pull request as ready for review March 18, 2021 08:23
binds/python/bind_immutable.cpp Show resolved Hide resolved
include/morphio/glial_cell.h Outdated Show resolved Hide resolved
@@ -152,7 +154,8 @@ class Morphology

If recursive == true, all descendent will be appended as well
**/
std::shared_ptr<Section> appendRootSection(const morphio::Section&, bool recursive = false);
std::shared_ptr<Section> appendRootSection(const morphio::Node<CellFamily::NEURON>&,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
std::shared_ptr<Section> appendRootSection(const morphio::Node<CellFamily::NEURON>&,
std::shared_ptr<Section> appendRootSection(const morphio::NeuronalSection&,

is equivalent.

I think it would be good to take the habit of no longer using the old alias Section or even Node<CellFamily::NEURON but the new NeuronalSection.
This will make MorphIO less neuron centric.

include/morphio/properties.h Show resolved Hide resolved
Comment on lines 279 to 284
/*
template <typename Node, typename CRTP, typename Mut>
const CellFamily& TTree<Node, CRTP, Mut>::cellFamily() const {
return _properties->cellFamily();
}
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

dead code

src/mut/glial_cell.cpp Show resolved Hide resolved
struct CellFamily {
struct NEURON {
using Type = SectionType;
static constexpr int value = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Those values must correspond to the values of the cell family in the spec.
https://bbpteam.epfl.ch/documentation/projects/Morphology%20Documentation/latest/h5v1.html

Maybe you can add a comment about it in the code.

include/morphio/types.h Show resolved Hide resolved
setup.py Outdated
Comment on lines 78 to 79
cfg = 'Debug' if self.debug else 'Release'
# cfg = 'Debug' if self.debug else 'Release'
cfg = 'Debug'
Copy link
Contributor

Choose a reason for hiding this comment

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

To be removed.

- Remove dead code
- Use alias NeuralSection instead of Node<CellFamily::NEURON>
- Use alias GlialSection instead of Node<CellFamily::GLIA>
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

Successfully merging this pull request may close these issues.

None yet

2 participants