geolib.models.meta

All D-Serie models store some metadata in the input files. These include projectnames, dates and times, remarks etc. All of these options are available via the Metadata class.

The Metadata class can also hold other properties for your project such as an compute endpoint.

Todo

Make a mapping between the possible metadata options and names for each model.

Classes

MetaData([_case_sensitive, _env_prefix, ...])

Holds all metadata found in the header of model files.

class geolib.models.meta.MetaData(_case_sensitive=None, _env_prefix=None, _env_file=PosixPath('.'), _env_file_encoding=None, _env_ignore_empty=None, _env_nested_delimiter=None, _env_parse_none_str=None, _env_parse_enums=None, _cli_prog_name=None, _cli_parse_args=None, _cli_settings_source=None, _cli_parse_none_str=None, _cli_hide_none_type=None, _cli_avoid_json=None, _cli_enforce_required=None, _cli_use_class_docs_for_groups=None, _cli_exit_on_error=None, _cli_prefix=None, _secrets_dir=None, **values)

Holds all metadata found in the header of model files.

Could be specified by default or in advance to make model generation easier.

Also can read these settings automatically from a ‘geolib.env’ file in the working directory, or give as ‘_env_file’ parameter.

Parameters:
  • _case_sensitive (Optional[bool])

  • _env_prefix (Optional[str])

  • _env_file (Union[Path, str, List[Union[Path, str]], Tuple[Union[Path, str], ...], None])

  • _env_file_encoding (Optional[str])

  • _env_ignore_empty (Optional[bool])

  • _env_nested_delimiter (Optional[str])

  • _env_parse_none_str (Optional[str])

  • _env_parse_enums (Optional[bool])

  • _cli_prog_name (Optional[str])

  • _cli_parse_args (UnionType[bool, list[str], tuple[str, ...], None])

  • _cli_settings_source (Optional[CliSettingsSource[Any]])

  • _cli_parse_none_str (Optional[str])

  • _cli_hide_none_type (Optional[bool])

  • _cli_avoid_json (Optional[bool])

  • _cli_enforce_required (Optional[bool])

  • _cli_use_class_docs_for_groups (Optional[bool])

  • _cli_exit_on_error (Optional[bool])

  • _cli_prefix (Optional[str])

  • _secrets_dir (UnionType[str, Path, None])

  • values (Any)

analyst: str
calculation_folder: Path
company: str
console_folder: Annotated[Path]
dfoundations_console_path: Optional[Path]
dgeoflow_console_path: Optional[Path]
dsettlement_console_path: Optional[Path]
dsheetpiling_console_path: Optional[Path]
dstability_console_path: Optional[Path]
endpoint: Annotated[Url]
extra_fields: str
gl_password: str
gl_username: str
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[SettingsConfigDict] = {'arbitrary_types_allowed': True, 'case_sensitive': False, 'cli_avoid_json': False, 'cli_enforce_required': False, 'cli_exit_on_error': True, 'cli_hide_none_type': False, 'cli_parse_args': None, 'cli_parse_none_str': None, 'cli_prefix': '', 'cli_prog_name': None, 'cli_settings_source': None, 'cli_use_class_docs_for_groups': False, 'env_file': 'geolib.env', 'env_file_encoding': None, 'env_ignore_empty': False, 'env_nested_delimiter': None, 'env_parse_enums': None, 'env_parse_none_str': None, 'env_prefix': '', 'extra': 'forbid', 'json_file': None, 'json_file_encoding': None, 'protected_namespaces': ('model_', 'settings_'), 'secrets_dir': None, 'toml_file': None, 'validate_default': True, 'yaml_file': None, 'yaml_file_encoding': None}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'analyst': FieldInfo(annotation=str, required=False, default=''), 'calculation_folder': FieldInfo(annotation=Path, required=False, default=PosixPath('tests/test_output/calculations')), 'company': FieldInfo(annotation=str, required=False, default=''), 'console_folder': FieldInfo(annotation=Path, required=False, default=PosixPath('.'), metadata=[PathType(path_type='dir')]), 'dfoundations_console_path': FieldInfo(annotation=Union[Path, NoneType], required=False, default=None), 'dgeoflow_console_path': FieldInfo(annotation=Union[Path, NoneType], required=False, default=None), 'dsettlement_console_path': FieldInfo(annotation=Union[Path, NoneType], required=False, default=None), 'dsheetpiling_console_path': FieldInfo(annotation=Union[Path, NoneType], required=False, default=None), 'dstability_console_path': FieldInfo(annotation=Union[Path, NoneType], required=False, default=None), 'endpoint': FieldInfo(annotation=Url, required=False, default='http://localhost:8000/', metadata=[UrlConstraints(max_length=None, allowed_schemes=['http', 'https'], host_required=None, default_host=None, default_port=None, default_path=None)]), 'extra_fields': FieldInfo(annotation=str, required=False, default='forbid'), 'gl_password': FieldInfo(annotation=str, required=False, default='test'), 'gl_username': FieldInfo(annotation=str, required=False, default='test'), 'nprocesses': FieldInfo(annotation=int, required=False, default=1), 'project': FieldInfo(annotation=str, required=False, default=''), 'remarks': FieldInfo(annotation=str, required=False, default='Created by GEOLib 2.5.0'), 'startdate': FieldInfo(annotation=datetime, required=False, default=datetime.datetime(2024, 9, 10, 11, 19, 2, 773318)), 'timeout': FieldInfo(annotation=int, required=False, default=600)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

nprocesses: int
project: str
remarks: str
startdate: datetime
timeout: int