pub struct ScientificProject { /* private fields */ }Expand description
Immutable configuration and state schema for one scientific project.
Cloning shares the parsed parameter, path, and schema allocations; it does not clone JSON values or scientific payloads.
Implementations§
Source§impl ScientificProject
impl ScientificProject
Sourcepub fn load(
project_root: impl Into<PathBuf>,
) -> Result<Self, ScientificProjectError>
pub fn load( project_root: impl Into<PathBuf>, ) -> Result<Self, ScientificProjectError>
Loads all four conventional JSON documents from project_root/config.
Sourcepub fn load_with_state_schema(
project_root: impl Into<PathBuf>,
state_schema: SystemStateSchema,
) -> Result<Self, ScientificProjectError>
pub fn load_with_state_schema( project_root: impl Into<PathBuf>, state_schema: SystemStateSchema, ) -> Result<Self, ScientificProjectError>
Loads task and path configuration with a model-owned state schema.
This form reads only config/fixed.json, config/sweep.json, and
config/paths.json. It is intended for scientific crates whose public
model fixes one canonical state contract and therefore rejects
project-specific schema changes. The supplied schema is already
validated by its type and is retained without reparsing or cloning its
field allocation.
Sourcepub fn project_root(&self) -> &Path
pub fn project_root(&self) -> &Path
Returns the project root exactly as supplied during loading.
Sourcepub fn configuration_directory(&self) -> &Path
pub fn configuration_directory(&self) -> &Path
Returns the conventional config/ directory.
Sourcepub fn parameters(&self) -> &ParameterSpace
pub fn parameters(&self) -> &ParameterSpace
Borrows the fixed-and-swept task parameter space.
Sourcepub fn paths(&self) -> &ProjectPaths
pub fn paths(&self) -> &ProjectPaths
Borrows the named project path dictionary.
Sourcepub fn resolve_path(&self, key: &str) -> Result<PathBuf, ConfigurationError>
pub fn resolve_path(&self, key: &str) -> Result<PathBuf, ConfigurationError>
Resolves one named project path against the project root.
Sourcepub fn task_count(&self) -> u64
pub fn task_count(&self) -> u64
Returns the checked number of complete task configurations.
Sourcepub fn task_config(
&self,
ordinal: u64,
) -> Result<TaskConfig, ConfigurationError>
pub fn task_config( &self, ordinal: u64, ) -> Result<TaskConfig, ConfigurationError>
Resolves one complete task configuration by deterministic ordinal.
Sourcepub fn task_configs(&self) -> TaskConfigIter ⓘ
pub fn task_configs(&self) -> TaskConfigIter ⓘ
Lazily iterates every complete fixed/sweep/path task configuration.
Sourcepub fn task_configs_matching<V>(
&self,
key: impl Into<String>,
value: V,
) -> Result<MatchingTaskConfigIter, ConfigurationError>where
V: Serialize,
pub fn task_configs_matching<V>(
&self,
key: impl Into<String>,
value: V,
) -> Result<MatchingTaskConfigIter, ConfigurationError>where
V: Serialize,
Lazily iterates every task matching one exact sweep key/value pair.
Sourcepub fn unique_task_config_matching<V>(
&self,
key: impl Into<String>,
value: V,
) -> Result<TaskConfig, ConfigurationError>where
V: Serialize,
pub fn unique_task_config_matching<V>(
&self,
key: impl Into<String>,
value: V,
) -> Result<TaskConfig, ConfigurationError>where
V: Serialize,
Returns the unique task matching one exact sweep key/value pair.
Sourcepub fn state_schema(&self) -> &SystemStateSchema
pub fn state_schema(&self) -> &SystemStateSchema
Borrows the shared project-owned or model-owned system-state schema.
Sourcepub fn configuration(&self) -> &ProjectConfig
pub fn configuration(&self) -> &ProjectConfig
Borrows the lower-level three-file configuration facade.
Sourcepub fn into_parts(self) -> (ProjectConfig, SystemStateSchema)
pub fn into_parts(self) -> (ProjectConfig, SystemStateSchema)
Consumes the project and returns its configuration and state schema.
Trait Implementations§
Source§impl Clone for ScientificProject
impl Clone for ScientificProject
Source§fn clone(&self) -> ScientificProject
fn clone(&self) -> ScientificProject
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more