Skip to content

Commit

Permalink
Reject erroneous extra configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
frthjf committed Oct 19, 2023
1 parent 33cc698 commit 2e5f564
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 6 deletions.
4 changes: 3 additions & 1 deletion src/miv_simulator/interface/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import logging

from machinable import Component
from pydantic import BaseModel, Field
from pydantic import BaseModel, Field, ConfigDict
from miv_simulator import config, simulator
from typing import Optional, Dict
from miv_simulator.utils import from_yaml
Expand All @@ -12,6 +12,8 @@

class Connections(Component):
class Config(BaseModel):
model_config = ConfigDict(extra="forbid")

filepath: str = Field("???")
forest_filepath: str = Field("???")
axon_extents: config.AxonExtents = Field("???")
Expand Down
4 changes: 3 additions & 1 deletion src/miv_simulator/interface/distances.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import Optional, Tuple

import logging
from pydantic import BaseModel
from pydantic import BaseModel, ConfigDict

from machinable import Component
from machinable.config import Field
Expand All @@ -11,6 +11,8 @@

class MeasureDistances(Component):
class Config(BaseModel):
model_config = ConfigDict(extra="forbid")

filepath: str = Field("???")
cell_distributions: config.CellDistributions = Field("???")
layer_extents: config.LayerExtents = Field("???")
Expand Down
4 changes: 3 additions & 1 deletion src/miv_simulator/interface/h5_types.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from machinable import Component
from pydantic import BaseModel, Field
from pydantic import BaseModel, Field, ConfigDict
from miv_simulator import config
from mpi4py import MPI
from miv_simulator.utils import io as io_utils, from_yaml
Expand All @@ -8,6 +8,8 @@

class H5Types(Component):
class Config(BaseModel):
model_config = ConfigDict(extra="forbid")

cell_distributions: config.CellDistributions = Field("???")
synapses: config.Synapses = Field("???")

Expand Down
4 changes: 3 additions & 1 deletion src/miv_simulator/interface/network_architecture.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
from miv_simulator import config, simulator
from miv_simulator.utils import io as io_utils, from_yaml
from mpi4py import MPI
from pydantic import BaseModel, Field
from pydantic import BaseModel, Field, ConfigDict


class NetworkArchitecture(Component):
"""Creates the network architecture by generating the soma coordinates within specified layer geometry."""

class Config(BaseModel):
model_config = ConfigDict(extra="forbid")

filepath: str = Field("???")
cell_distributions: config.CellDistributions = Field("???")
synapses: config.Synapses = Field("???")
Expand Down
4 changes: 3 additions & 1 deletion src/miv_simulator/interface/synapse_forest.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
from machinable import Component
from miv_simulator import config, simulator
from pydantic import BaseModel, Field
from pydantic import BaseModel, Field, ConfigDict


class GenerateSynapseForest(Component):
class Config(BaseModel):
model_config = ConfigDict(extra="forbid")

filepath: str = Field("???")
population: config.PopulationName = Field("???")
morphology: config.SWCFilePath = Field("???")
Expand Down
4 changes: 3 additions & 1 deletion src/miv_simulator/interface/synapses.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
from machinable import Component
from miv_simulator import config
from miv_simulator import simulator
from pydantic import BaseModel, Field
from pydantic import BaseModel, Field, ConfigDict
from typing import Optional, Dict
from miv_simulator.utils import from_yaml
from mpi4py import MPI


class Synapses(Component):
class Config(BaseModel):
model_config = ConfigDict(extra="forbid")

forest_filepath: str = Field("???")
cell_types: config.CellTypes = Field("???")
population: str = Field("???")
Expand Down

0 comments on commit 2e5f564

Please sign in to comment.