NEML2 2.0.0
Loading...
Searching...
No Matches
core Namespace Reference

Classes

class  LabeledAxis
 
class  LabeledAxisAccessor
 
class  MatrixAssembler
 
class  Model
 
class  TensorValue
 
class  VectorAssembler
 

Functions

None diagnose (Model model)
 
Model get_model (str model, bool force_create=True)
 
None load_input (os.PathLike path, str cli_args='')
 
Model load_model (os.PathLike path, str model)
 
None reload_input (os.PathLike path, str cli_args='')
 
Model reload_model (os.PathLike path, str model)
 

Detailed Description

NEML2 Python bindings

Function Documentation

◆ diagnose()

None diagnose ( Model model)
Diagnose common issues in model setup. Raises a runtime error including all identified issues, if any.

:param model: Model to be diagnosed

◆ get_model()

Model get_model ( str model,
bool force_create = True )
Create a models.Model from given input options. The input file must have
already been parsed and loaded.

:param model:        Name of the model
:param force_create: Whether to force create the model even if one has already been created

◆ load_input()

None load_input ( os.PathLike path,
str cli_args = '' )
Parse all options from an input file. Note that Previously loaded input options
will be discarded.

:param path:     Path to the input file to be parsed
:parma cli_args: Additional command-line arguments to pass to the parser

◆ load_model()

Model load_model ( os.PathLike path,
str model )
A convenient function to load an input file and get a model.

This function is equivalent to calling core.load_input followed by
core.get_model. Note that this convenient function does not support passing
additional command-line arguments and will force the creation of a new
models.Model even if one has already been created. Use core.load_input and
core.get_model if you need finer control over the model creation behavior.

:param path:      Path to the input file to be parsed
:param model:     Name of the model

◆ reload_input()

None reload_input ( os.PathLike path,
str cli_args = '' )
Similar to core.load_input, except that this function additionally clears the
factory so that previously retrieved models are deleted.

This function is only needed if you load and evaluate models inside a for-loop,
where it is desirable to deallocate models on-the-fly.

:param path:     Path to the input file to be parsed
:param cli_args: Additional command-line arguments to pass to the parser

◆ reload_model()

Model reload_model ( os.PathLike path,
str model )
Similar to core.load_model, except that this function additionally clears the
factory so that previously retrieved models are deleted.

This function is only needed if you load and evaluate models inside a for-loop,
where it is desirable to deallocate models on-the-fly.

:param path:      Path to the input file to be parsed
:param model:     Name of the model