Skip to content

Commit

Permalink
Chore: Add JSON schemas to ListParameter objects
Browse files Browse the repository at this point in the history
  • Loading branch information
adrien-berchet committed Jan 31, 2023
1 parent 50873ab commit 03a48db
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/synthesis_workflow/tasks/circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,15 @@ class CreateAtlasPlanes(WorkflowTask):
":list(int): (only for plane_type == centerline) Location of first bound for "
"centerline (in voxcell index)."
),
schema={"type": "array", "items": {"type": "number"}, "minItems": 3, "maxItems": 3},
)
centerline_last_bound = luigi.OptionalListParameter(
default=None,
description=(
":list(int): (only for plane_type == centerline) Location of last bound for "
"centerline (in voxcell index)."
),
schema={"type": "array", "items": {"type": "number"}, "minItems": 3, "maxItems": 3},
)
centerline_axis = luigi.IntParameter(
default=0,
Expand Down
6 changes: 5 additions & 1 deletion src/synthesis_workflow/tasks/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ class DiametrizerConfig(luigi.Config):
taper_max = luigi.FloatParameter(default=1e-6)
asymmetry_threshold_basal = luigi.FloatParameter(default=1.0)
asymmetry_threshold_apical = luigi.FloatParameter(default=0.2)
neurite_types = luigi.ListParameter(default=["basal_dendrite", "apical_dendrite"])
neurite_types = luigi.ListParameter(
default=["basal_dendrite", "apical_dendrite"],
schema={"type": "array", "items": {"type": "string"}},
)

trunk_max_tries = luigi.IntParameter(default=100)
n_samples = luigi.IntParameter(default=2)
Expand Down Expand Up @@ -169,6 +172,7 @@ class SynthesisConfig(luigi.Config):
":list(str): The list of mtypes to process (default is None, which means that all "
"found mtypes are taken)."
),
schema={"type": "array", "items": {"type": "string"}},
)
with_axons = luigi.BoolParameter(
default=False, description=":bool: Set to True to synthesize local axons"
Expand Down
2 changes: 2 additions & 0 deletions src/synthesis_workflow/tasks/synthesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class BuildMorphsDF(WorkflowTask):
morphology_dirs = luigi.OptionalDictParameter(
default=None,
description=(":dict: mapping between column names and paths to each morphology file."),
schema={"type": "object", "patternProperties": {".*": {"type": "string"}}},
)
apical_points_path = luigi.OptionalParameter(
default=None, description=":str: Path to the apical points file (JSON)."
Expand Down Expand Up @@ -325,6 +326,7 @@ class BuildAxonMorphologies(WorkflowTask):
placement_scales = luigi.OptionalListParameter(
default=None,
description=":list: See ``placementAlgorithm.app.choose_morphologies``.",
schema={"type": "array", "items": {"type": "number", "exclusiveMinimum": 0}},
)
placement_seed = luigi.IntParameter(
default=0,
Expand Down
1 change: 1 addition & 0 deletions src/synthesis_workflow/tasks/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ class PlotScales(WorkflowTask):
":str: The extra columns that should be plotted (these columns must exist in the debug "
"data)."
),
schema={"type": "array", "items": {"type": "string"}},
)

def requires(self):
Expand Down
3 changes: 0 additions & 3 deletions tests/data/in_vacuum/luigi.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ morphology_dirs = {"morphology_path": "<path_to_input_cells>"}
[ApplySubstitutionRules]
substitution_rules_path = substitution_rules.yaml

[BuildSynthesisParameters]
input_tmd_parameters_path = tmd_specific_parameters.json

# synthesize in vacuum
[VacuumSynthesize]
n_cells = 10
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ commands =
--cov={envsitepackagesdir}/{[base]name} \
--cov={envsitepackagesdir}/{[base]morphval} \
--cov-branch \
--cov-fail-under=58 \
--cov-fail-under=57 \
--no-cov-on-fail \
--cov-report term-missing \
--cov-report html:reports/coverage-{envname} \
Expand Down

0 comments on commit 03a48db

Please sign in to comment.