Skip to content

Commit

Permalink
Update schemas (#167)
Browse files Browse the repository at this point in the history
* Added astrocyte, vasculature node types
* Updated datatypes.yaml, node.yaml, edge.yaml
* Removed unused types.json
* added schemas for enfoot, glialglial, neuromodulatory, synapse_astrocyte edge types
* Added missing properties
* Removed restrictions on additional properties
* Remove restriction on the number of populations/file
* Do not restrict the (u)int type used in indices
  • Loading branch information
joni-herttuainen committed Sep 6, 2022
1 parent 9bb210f commit d87e06f
Show file tree
Hide file tree
Showing 12 changed files with 244 additions and 102 deletions.
4 changes: 0 additions & 4 deletions bluepysnap/schemas/circuit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ title: SONATA Circuit Config
description: schema for BBP SONATA circuit config
required:
- networks
additionalProperties: false
properties:
version:
type: number
Expand All @@ -17,7 +16,6 @@ properties:
required:
- nodes
- edges
additionalProperties: false
properties:
nodes:
$ref: "#/$defs/network_array"
Expand All @@ -37,7 +35,6 @@ $defs:
type: string
alternate_morphologies:
type: object
additionalProperties: false
properties:
h5v1:
type: string
Expand All @@ -60,7 +57,6 @@ $defs:
type: object
required:
- populations
additionalProperties: false
properties:
edges_file:
type: string
Expand Down
27 changes: 27 additions & 0 deletions bluepysnap/schemas/definitions/datatypes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,50 @@ $typedefs:
index_or_utf8:
anyOf:
- $ref: "#/$typedefs/utf8"
- $ref: "#/$typedefs/int8"
- $ref: "#/$typedefs/int16"
- $ref: "#/$typedefs/int32"
- $ref: "#/$typedefs/int64"
- $ref: "#/$typedefs/uint8"
- $ref: "#/$typedefs/uint16"
- $ref: "#/$typedefs/uint32"
- $ref: "#/$typedefs/uint64"

float32:
$ref: "#/$typedefs/general"
properties:
datatype:
const: float32
int8:
$ref: "#/$typedefs/general"
properties:
datatype:
const: int8
int16:
$ref: "#/$typedefs/general"
properties:
datatype:
const: int16
int32:
$ref: "#/$typedefs/general"
properties:
datatype:
const: int32
int64:
$ref: "#/$typedefs/general"
properties:
datatype:
const: int64
uint8:
$ref: "#/$typedefs/general"
properties:
datatype:
const: uint8
uint16:
$ref: "#/$typedefs/general"
properties:
datatype:
const: uint16
uint32:
$ref: "#/$typedefs/general"
properties:
Expand Down
59 changes: 42 additions & 17 deletions bluepysnap/schemas/definitions/edge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ description: schema definitions that apply to all edge files
$edge_file_defs:
indices_id_mapping:
type: object
additionalProperties: false
properties:
node_id_to_ranges:
$ref: "#/$typedefs/uint64"
Expand All @@ -28,7 +27,6 @@ $edge_file_defs:
- edges
properties:
edges:
maxProperties: 1
minProperties: 1
type: object
patternProperties:
Expand All @@ -40,11 +38,9 @@ $edge_file_defs:
- edge_type_id
- source_node_id
- target_node_id
additionalProperties: false
properties:
indices: # Note that this is optional
type: object
additionalProperties: false
properties:
target_to_source:
$ref: "#/$edge_file_defs/indices_id_mapping"
Expand All @@ -61,7 +57,6 @@ $edge_file_defs:

"0":
type: object
# additionalProperties: false
patternProperties:
# For docs, these would likely need to be changed actual property names.
# Best probably combine each to a definition like "#/edge_field_defs/..._xyz"
Expand All @@ -72,38 +67,68 @@ $edge_file_defs:
$ref: "#/$typedefs/uint32"
^(a|e)fferent_(section|segment)_(pos|offset)$:
$ref: "#/$typedefs/float32"
^astrocyte_center_(x|y|z)$:
$ref: "#/$typedefs/float32"
^astrocyte_(section|segment)_id$:
$ref: "#/$typedefs/uint32"
^endfoot_compartment_(length|diameter|perimeter)$:
$ref: "#/$typedefs/float32"
^endfoot_surface_(x|y|z)$:
$ref: "#/$typedefs/float32"
^neuromod_(dtc|strength)$:
$ref: "#/$typedefs/float32"
^vasculature_(section|segment)_id$:
$ref: "#/$typedefs/uint32"
properties:
astrocyte_section_pos:
$ref: "#/$typedefs/float32"
astrocyte_segment_offset:
$ref: "#/$typedefs/float32"
conductance:
$ref: "#/$typedefs/float32"
conductance_scale_factor:
$ref: "#/$typedefs/float32"
decay_time:
$ref: "#/$typedefs/float32"
delay:
$ref: "#/$typedefs/float32"
depression_time:
$ref: "#/$typedefs/float32"
endfoot_id:
$ref: "#/$typedefs/uint64"
facilitation_time:
$ref: "#/$typedefs/float32"
u_syn:
$ref: "#/$typedefs/float32"
n_rrp_vesicles:
$ref: "#/$typedefs/uint32"
spine_length:
$ref: "#/$typedefs/float32"
syn_type_id:
$ref: "#/$typedefs/uint32"
delay:
$ref: "#/$typedefs/float32"
# Optional properties
spine_morphology:
$ref: "#/$typedefs/uint32"
$ref: "#/$typedefs/index_or_utf8"
spine_psd_id:
$ref: "#/$typedefs/int64"
spine_sharding_id:
$ref: "#/$typedefs/int64"
conductance_scale_factor:
$ref: "#/$typedefs/float32"
syn_type_id:
$ref: "#/$typedefs/uint32"
synapse_id:
$ref: "#/$typedefs/uint64"
required:
- attributes
properties:
attributes:
type: object
required:
- edge_population
properties:
edge_population:
type: string
u_hill_coefficient:
$ref: "#/$typedefs/float32"
u_syn:
$ref: "#/$typedefs/float32"
"@library":
type: object
properties:
spine_morphology:
patternProperties:
# "" is used as a wild card for field name
"":
$ref: "#/$typedefs/utf8"
65 changes: 37 additions & 28 deletions bluepysnap/schemas/definitions/node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ $node_file_defs:
- nodes
properties:
nodes:
maxProperties: 1
minProperties: 1
type: object
patternProperties:
Expand All @@ -16,65 +15,75 @@ $node_file_defs:
required:
- "0"
- node_type_id
additionalProperties: false
properties:
node_type_id:
$ref: "#/$typedefs/int64"
"0":
#additionalProperties: false
type: object
properties:
mtype:
$ref: "#/$typedefs/index_or_utf8"
morphology:
$ref: "#/$typedefs/index_or_utf8"
model_template:
$ref: "#/$typedefs/index_or_utf8"
model_type:
$ref: "#/$typedefs/index_or_utf8"
morph_class:
$ref: "#/$typedefs/index_or_utf8"
etype:
$ref: "#/$typedefs/index_or_utf8"
mtype:
$ref: "#/$typedefs/index_or_utf8"
synapse_class:
$ref: "#/$typedefs/index_or_utf8"
dynamics_params:
type: object
required:
- threshold_current
- holding_current
additionalProperties: false
properties:
threshold_current:
AIS_scaler:
$ref: "#/$typedefs/float32"
holding_current:
$ref: "#/$typedefs/float32"
input_resistance:
$ref: "#/$typedefs/float32"
threshold_current:
$ref: "#/$typedefs/float32"
etype:
$ref: "#/$typedefs/index_or_utf8"
exc-mini_frequency:
$ref: "#/$typedefs/float32"
hemisphere:
$ref: "#/$typedefs/index_or_utf8"
inh-mini_frequency:
$ref: "#/$typedefs/float32"
layer:
$ref: "#/$typedefs/index_or_utf8"
me_combo:
$ref: "#/$typedefs/index_or_utf8"
region:
model_template:
$ref: "#/$typedefs/index_or_utf8"
exc-mini_frequency:
$ref: "#/$typedefs/float32"
inh-mini_frequency:
model_type:
$ref: "#/$typedefs/index_or_utf8"
morphology:
$ref: "#/$typedefs/index_or_utf8"
morph_class:
$ref: "#/$typedefs/index_or_utf8"
mtype:
$ref: "#/$typedefs/index_or_utf8"
radius:
$ref: "#/$typedefs/float32"
hemisphere:
region:
$ref: "#/$typedefs/index_or_utf8"
section_id:
$ref: "#/$typedefs/uint32"
segment_id:
$ref: "#/$typedefs/uint32"
synapse_class:
$ref: "#/$typedefs/index_or_utf8"
type:
$ref: "#/$typedefs/int32"
"@library":
type: object
patternProperties:
# "" is used as a wild card for field name
"":
$ref: "#/$typedefs/utf8"
patternProperties:
^(x|y|z)$:
^(start_|end_)?(x|y|z)$:
$ref: "#/$typedefs/float32"
^(start|end)_diameter$:
$ref: "#/$typedefs/float32"
^(start|end)_node$:
$ref: "#/$typedefs/uint64"
^rotation_angle_(x|y|z)axis$:
$ref: "#/$typedefs/float32"
# Optional
^orientation_(w|x|y|z)$:
$ref: "#/$typedefs/float32"

Expand Down
21 changes: 21 additions & 0 deletions bluepysnap/schemas/edge/endfoot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
title: Edges - endfoot
description: schema for endfoot edge types
allOf: [{ $ref: "#/$edge_file_defs/edges_file_root" }]
properties:
edges:
patternProperties:
# "" is used as a wild card for population name
"":
properties:
"0":
required:
- endfoot_id
- endfoot_surface_x
- endfoot_surface_y
- endfoot_surface_z
- vasculature_section_id
- vasculature_segment_id
- astrocyte_section_id
- endfoot_compartment_length
- endfoot_compartment_diameter
- endfoot_compartment_perimeter
34 changes: 34 additions & 0 deletions bluepysnap/schemas/edge/glialglial.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
title: Edges - glialglial
description: schema for glialglial edge types
allOf: [{ $ref: "#/$edge_file_defs/edges_file_root" }]
properties:
edges:
patternProperties:
# "" is used as a wild card for population name
"":
properties:
"0":
required:
- afferent_center_x
- afferent_center_y
- afferent_center_z
- afferent_surface_x
- afferent_surface_y
- afferent_surface_z
- afferent_section_id
- afferent_section_pos
- afferent_section_type
- afferent_segment_id
- afferent_segment_offset
- efferent_center_x
- efferent_center_y
- efferent_center_z
- efferent_surface_x
- efferent_surface_y
- efferent_surface_z
- efferent_section_id
- efferent_section_pos
- efferent_section_type
- efferent_segment_id
- efferent_segment_offset
- spine_length
17 changes: 17 additions & 0 deletions bluepysnap/schemas/edge/neuromodulatory.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
title: Edges - neuromodulatory
description: schema for neuromodulatory edge types
allOf: [{ $ref: "#/$edge_file_defs/edges_file_root" }]
properties:
edges:
patternProperties:
# "" is used as a wild card for population name
"":
properties:
"0":
required:
- afferent_section_id
- afferent_section_pos
- afferent_segment_id
- delay
- neuromod_dtc
- neuromod_strength

0 comments on commit d87e06f

Please sign in to comment.