Skip to main content

Config

Struct Config 

Source
pub struct Config {
    pub build: Option<String>,
    pub python: PathBuf,
    pub tree: Option<String>,
    pub goal: Option<String>,
}
Expand description

soma-tree.toml, at the root of the repository being explored.

Fields§

§build: Option<String>

module:function — takes nothing, returns a Graph.

Optional, and not as a convenience: reading an investigation’s reasoning should not require knowing how to build its graph. Finished work — a paper, a repository nobody runs, one from before soma — has reasoning worth reading and may have nothing to probe. Without it, what needs a probe says so and the rest works.

§python: PathBuf

The interpreter that can import somatize. Rarely the one on PATH.

§tree: Option<String>

What this investigation is called, so several can share one store without seeing each other. Defaults to the repository’s own name.

It is in the name records are bound under, which is the one part of this that cannot be changed later without moving somebody’s directories.

§goal: Option<String>

Which way is better: min for a loss, max for an accuracy.

Declared here because it is not in the store: the direction lives in the Goal handed to a sampler and is written in no record. Without it trials are shown by their range, which is true anyway.

Implementations§

Source§

impl Config

Source

pub fn building(&self) -> Result<&str, String>

How to build the graph, or why it cannot be.

The message is for whoever is about to probe and not for whoever reads: somebody looking at the reasoning never gets here.

Source

pub fn read(repo: &Path) -> Result<Self, String>

Read from the repository and not from the checkout: how an experiment is built is a fact about the project now, and reading it out of each commit would leave one predating the file unprobeable.

Not being there is not a failure, for the same reason build is optional: a repository from before soma has a reasoning worth reading and nothing to probe, and it has no soma-tree.toml either. What needs a probe still says so, through building.

Source

pub fn towards(&self) -> Result<Option<Goal>, String>

Which way is better, if it was declared. What is not understood is refused rather than read as not declared: a typo in goal would stop saying which was best with nothing saying why.

Source

pub fn tree(&self, repo: &Path) -> String

Source

pub fn interpreter(&self, repo: &Path) -> PathBuf

The interpreter, made absolute against the repo so that a relative .venv/bin/python still resolves once the probe runs in a worktree somewhere else entirely.

Trait Implementations§

Source§

impl<'de> Deserialize<'de> for Config

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,