BlueBrain / morphoclass

Neuronal morphology preparation and classification using Machine Learning.
https://morphoclass.readthedocs.io
Apache License 2.0
8 stars 4 forks source link

New stages for IN with PROJ in dvc.yaml #69

Closed FrancescoCasalegno closed 2 years ago

FrancescoCasalegno commented 2 years ago

Fixes #67

Description

Please provide here a summary of the changes introduced by this PR.

How to test?

Test new DVC stages for extract-features

import yaml

with open("dvc.yaml") as f:
     d = yaml.safe_load(f)["stages"]

keys = {k for k in d.keys() if re.search(r"features.*in.*rd", k)}
print(f"--- Found {len(keys)} keys")

for k_rd in sorted(keys):
     print(k_rd)
     k_proj = re.sub(r"rd-", "proj-", k_rd)
     assert k_proj in d.keys()
     d1 = d[k_rd]
     d2 = d[k_proj]
     for (k1, v1), (k2, v2) in zip(d1.items(), d2.items()):
         if isinstance(v1, list):
             v1 = "\n".join(v1)
         if isinstance(v2, list):
             v2 = "\n".join(v2)
         assert k1 == k2
         assert v2 == re.sub(r"-rd", "-proj", v1)

should print

--- Found 63 keys
features-in-L1-diagram-tmd-rd-all
features-in-L1-diagram-tmd-rd-axon
features-in-L1-diagram-tmd-rd-basal
features-in-L1-graph-rd-all
features-in-L1-graph-rd-axon
features-in-L1-graph-rd-basal
features-in-L1-image-tmd-rd-all
features-in-L1-image-tmd-rd-axon
features-in-L1-image-tmd-rd-basal
features-in-L23-diagram-tmd-rd-all
features-in-L23-diagram-tmd-rd-axon
features-in-L23-diagram-tmd-rd-basal
features-in-L23-graph-rd-all
features-in-L23-graph-rd-axon
features-in-L23-graph-rd-basal
features-in-L23-image-tmd-rd-all
features-in-L23-image-tmd-rd-axon
features-in-L23-image-tmd-rd-basal
features-in-L4-diagram-tmd-rd-all
features-in-L4-diagram-tmd-rd-axon
features-in-L4-diagram-tmd-rd-basal
features-in-L4-graph-rd-all
features-in-L4-graph-rd-axon
features-in-L4-graph-rd-basal
features-in-L4-image-tmd-rd-all
features-in-L4-image-tmd-rd-axon
features-in-L4-image-tmd-rd-basal
features-in-L5-diagram-tmd-rd-all
features-in-L5-diagram-tmd-rd-axon
features-in-L5-diagram-tmd-rd-basal
features-in-L5-graph-rd-all
features-in-L5-graph-rd-axon
features-in-L5-graph-rd-basal
features-in-L5-image-tmd-rd-all
features-in-L5-image-tmd-rd-axon
features-in-L5-image-tmd-rd-basal
features-in-L6-diagram-tmd-rd-all
features-in-L6-diagram-tmd-rd-axon
features-in-L6-diagram-tmd-rd-basal
features-in-L6-graph-rd-all
features-in-L6-graph-rd-axon
features-in-L6-graph-rd-basal
features-in-L6-image-tmd-rd-all
features-in-L6-image-tmd-rd-axon
features-in-L6-image-tmd-rd-basal
features-lida-in-merged-bc-merged-diagram-tmd-rd-all
features-lida-in-merged-bc-merged-diagram-tmd-rd-axon
features-lida-in-merged-bc-merged-diagram-tmd-rd-basal
features-lida-in-merged-bc-merged-graph-rd-all
features-lida-in-merged-bc-merged-graph-rd-axon
features-lida-in-merged-bc-merged-graph-rd-basal
features-lida-in-merged-bc-merged-image-tmd-rd-all
features-lida-in-merged-bc-merged-image-tmd-rd-axon
features-lida-in-merged-bc-merged-image-tmd-rd-basal
features-lida-in-merged-diagram-tmd-rd-all
features-lida-in-merged-diagram-tmd-rd-axon
features-lida-in-merged-diagram-tmd-rd-basal
features-lida-in-merged-graph-rd-all
features-lida-in-merged-graph-rd-axon
features-lida-in-merged-graph-rd-basal
features-lida-in-merged-image-tmd-rd-all
features-lida-in-merged-image-tmd-rd-axon
features-lida-in-merged-image-tmd-rd-basal

Checklist