Version:

salvus.material.orientation

salvus.material.orientation salvus material orientation
Experimental orientation materials.

Functions

visualize_local_bases()

Visualize the local bases rosette of a material.
Helpful for understanding rotations. Works best for only a few orientations.
SIGNATURE
def visualize_local_bases(
    material: _OrientedMaterial,
    vector_scale: float = 10.0,
    allow_many: bool = False,
) -> Figure: ...
ARGUMENTS
Required
material
Type:_OrientedMaterial
Description:
An orientation material.
Optional
vector_scale
Type:float
Default value:10.0
Description:
Optional scaling passed on to Matplotlib's quiver.
Optional
allow_many
Type:bool
Default value:False
Description:
If True, disables the check on the maximum number of rotations.
RETURNS
Return type: Figure
The created matplotlib figure.

Classes

AxesDips

An orientation material parameterized by dip angles in the X and Y direction.
Rotationally (around local Z) ambiguous.
SIGNATURE
class AxesDips(salvus.material.orientation._OrientedMaterial):
    def __init__(
        self,
        DIP_X: _pd.types.ParameterOrConstantT,
        DIP_Y: _pd.types.ParameterOrConstantT,
    ) -> None: ...
ARGUMENTS
Required
DIP_X
Type:_pd.types.ParameterOrConstantT
Description:
Dip away from vertical in the XZ plane, in degrees.
Required
DIP_Y
Type:_pd.types.ParameterOrConstantT
Description:
Dip away from vertical in the YZ plane, in degrees.

Properties

  • ds(typing.Mapping)-Material's xarray representation.
  • flatten(dict)-Get all parameters as a dict.

Class Methods

AxesDips.from_dataset()
Construct a material from an xarray Dataset.
SIGNATURE
def from_dataset(ds: xr.Dataset) -> Material[_pd.types.ParameterFlavorT]: ...
ARGUMENTS
Required
ds
Type:xr.Dataset
Description:
The dataset to construct the material from.
AxesDips.from_json()
Recreate the object from a dictionary serialization of its initialization parameters.
SIGNATURE
def from_json(d: builtins.dict) -> Any: ...
ARGUMENTS
Required
d
Type:builtins.dict
Description:
Dictionary containing its init parameters and a few other things.
AxesDips.from_material()
Construct this material from another within the same physical system.
SIGNATURE
def from_material(
    m: Material[_pd.types.ParameterFlavorT],
    reduction_method: (
        typing.Literal["remove-components", "force"] | None
    ) = None,
) -> typing.Self: ...
ARGUMENTS
Required
m
Type:Material[_pd.types.ParameterFlavorT]
Description:
Material to transform.
Optional
reduction_method
Type:typing.Literal['remove-components', 'force'] | None
Default value:None
Description:
Method to move between incompatible symmetry classes. None will only move to symmetries that are equal or more permissive, while remove-components will drop components that are found to match the new material's constraints as necessary, and thus leading to loss of free parameters but not of information. The option "force" will take all information necessary to construct the new parameter set without verification, leading to loss of information.
AxesDips.from_params()
Construct this material from generic parameters.
SIGNATURE
def from_params(
    dip_x: _pd.types.ParameterInput, dip_y: _pd.types.ParameterInput
) -> typing.Self: ...
ARGUMENTS
Required
dip_x
Type:_pd.types.ParameterInput
Description:
Dip away from vertical in the XZ plane, in degrees.
Required
dip_y
Type:_pd.types.ParameterInput
Description:
Dip away from vertical in the YZ plane, in degrees.
AxesDips.material_system()
Method that will return the material system of material.
SIGNATURE
def material_system() -> type[Material]: ...

Methods

AxesDips.generate_rotation_matrix()
Create the rotation matrix for this orientation material.
SIGNATURE
def generate_rotation_matrix(self) -> npt.NDArray: ...
AxesDips.get_basis_vector()
Gets one of the local basis vectors.
SIGNATURE
def get_basis_vector(
    self, axis: typing.Literal["local_X", "local_Y", "local_Z"]
) -> npt.NDArray: ...
ARGUMENTS
Required
axis
Type:typing.Literal['local_X', 'local_Y', 'local_Z']
Description:
The local basis vector to get.
AxesDips.get_basis_vectors()
Get local basis vectors for a material expressed in global coordinates.
SIGNATURE
def get_basis_vectors(
    self,
) -> tuple[npt.NDArray, npt.NDArray, npt.NDArray]: ...
AxesDips.map()
Generic map for dataclass instances.
f should be a function taking two parameters: the name of the dataclass member and its value, and it should return a tuple containing the same quantities. If a member is not to be transformed, f should just return a tuple of the input member name and value, unchanged. Both names and values can be transformed, with the semantics following those of dataclasses.replace.
In Salvus we primarily treat dataclasses as containers offering semantics similar to typed dictionaries. Deriving from this protocol allows any relevant dataclass to additionally be treated functorially. This allows for the generic un- and re-wrapping of value held in dataclasses, and essentially replaces the following imperative code:
@dataclass
class A:
    member: int

# Before
my_a = A(member=1)
my_a_new = dataclasses.replace(my_a, member=2 * my_a.member)

# After
my_a_new = A(val=1).map(lambda key, val: (key, 2 * val))
As with many functional patterns, the perceived benefits for simple demonstrative purposes is minimal. The scalability of this pattern becomes apparent, however, when parsing deeply nested abstractions, as the transformation logic can be factored out into independent functions. This is used extensively, for example, in the realization logic of the layered mesher, where generic materials can have generic parameters, etc.
SIGNATURE
def map(
    self, f: typing.Callable[[str, typing.Any], tuple[str, typing.Any]]
) -> typing.Self: ...
ARGUMENTS
Required
f
Type:typing.Callable[[str, typing.Any], tuple[str, typing.Any]]
Description:
The function to map over the dataclass.
AxesDips.map_realized_parameters()
Apply functions to each parameter individually, distinguishing _pd.
Useful when one wants to transform each parameter type separately. For instance, transformations of discrete parameters often require more associated logic than their constant equivalents. This function abstracts away the boilerplate of check for each parameter type, and subsequently transforming it with some function, as well as ensuring that the parameters are indeed of the correct realized type.
The signatures of each transformation function should take the parameter's name and value as two distinct inputs, and return the (potentially modified) parameter value.
SIGNATURE
def map_realized_parameters(
    self,
    f_constant: typing.Callable[
        [str, _pd.realized.constant.Parameter], _pd.realized.constant.Parameter
    ] = salvus.material.base_materials._map_realized_default,
    f_discrete: typing.Callable[
        [str, _pd.realized.discrete.Parameter], _pd.realized.discrete.Parameter
    ] = salvus.material.base_materials._map_realized_default,
    f_analytic: typing.Callable[
        [str, _pd.realized.analytic.Parameter], _pd.realized.analytic.Parameter
    ] = salvus.material.base_materials._map_realized_default,
) -> Self: ...
ARGUMENTS
Optional
f_constant
Type:typing.Callable[[str, _pd.realized.constant.Parameter], _pd.realized.constant.Parameter]
Default value:salvus.material.base_materials._map_realized_default
Description:
The function to apply to constant parameters. Defaults to returning the parameter as-is.
Optional
f_discrete
Type:typing.Callable[[str, _pd.realized.discrete.Parameter], _pd.realized.discrete.Parameter]
Default value:salvus.material.base_materials._map_realized_default
Description:
The function to apply to discrete parameters. Defaults to returning the parameter as-is.
Optional
f_analytic
Type:typing.Callable[[str, _pd.realized.analytic.Parameter], _pd.realized.analytic.Parameter]
Default value:salvus.material.base_materials._map_realized_default
Description:
The function to apply to analytic parameters. Defaults to returning the parameter as-is.
AxesDips.qc_test()
Run a series of material quality control tests.
The function also prints a summary of the issues found, including their severity and any mitigation steps that can be taken.
SIGNATURE
def qc_test(
    self,
    level: validation.QCLevel | str = QCLevel.strict,
    display_issues: bool = True,
) -> dict[str, MaterialQCIssue]: ...
ARGUMENTS
Optional
level
Type:validation.QCLevel | str
Default value:QCLevel.strict
Description:
The level of quality control to perform. The BASIC level performs minimal checks, while the STRICT level performs more thorough checks that are potentially slow. One can pass an enumeration value or a string representation of the level.
Optional
display_issues
Type:bool
Default value:True
Description:
If True, prints the issues found during the quality control checks. If False, issues are collected but not printed.
AxesDips.to_json()
Serialize the object to a dictionary that can be written to JSON.
SIGNATURE
def to_json(
    self,
    external_file_hash: types = None,
    timer: types = None,
    log_to_logger: bool = False,
    comm: types = None,
) -> builtins.dict: ...
ARGUMENTS
Optional
external_file_hash
Type:types
Default value:None
Description:
Hash of any external files associated with this object. Can be passed here in which case it will be stored in a centralized location in the JSON file.
Optional
timer
Type:types
Default value:None
Description:
Execution timer.
Optional
log_to_logger
Type:bool
Default value:False
Description:
Log timings to the logger.
Optional
comm
Type:types
Default value:None
Description:
MPI communicator, if any.
AxesDips.to_wavelength_oracle()
The wavelength oracle.
SIGNATURE
def to_wavelength_oracle(
    self, n_dim: typing.Literal[2, 3] | None = None
) -> _pd.types.ParameterOrConstantT: ...
ARGUMENTS
Optional
n_dim
Type:typing.Literal[2, 3] | None
Default value:None
Description:
Dimension to return the oracle for, deprecated.
AxesDips.with_orientation()
Experimetal method to add orientation to a material.
SIGNATURE
def with_orientation(self, orientation: Material | None) -> Material: ...
ARGUMENTS
Required
orientation
Type:Material | None
Description:
The orientation.

AzimuthDip

An orientation material parameterized by dip and azimuth.
Rotationally (around local Z) ambiguous.
SIGNATURE
class AzimuthDip(salvus.material.orientation._OrientedMaterial):
    def __init__(
        self,
        AZIMUTH: _pd.types.ParameterOrConstantT,
        DIP: _pd.types.ParameterOrConstantT,
    ) -> None: ...
ARGUMENTS
Required
AZIMUTH
Type:_pd.types.ParameterOrConstantT
Description:
Azimuth away from X (towards Y) in degrees.
Required
DIP
Type:_pd.types.ParameterOrConstantT
Description:
Dip away from vertical in degrees,

Properties

  • ds(typing.Mapping)-Material's xarray representation.
  • flatten(dict)-Get all parameters as a dict.

Class Methods

AzimuthDip.from_dataset()
Construct a material from an xarray Dataset.
SIGNATURE
def from_dataset(ds: xr.Dataset) -> Material[_pd.types.ParameterFlavorT]: ...
ARGUMENTS
Required
ds
Type:xr.Dataset
Description:
The dataset to construct the material from.
AzimuthDip.from_json()
Recreate the object from a dictionary serialization of its initialization parameters.
SIGNATURE
def from_json(d: builtins.dict) -> Any: ...
ARGUMENTS
Required
d
Type:builtins.dict
Description:
Dictionary containing its init parameters and a few other things.
AzimuthDip.from_material()
Construct this material from another within the same physical system.
SIGNATURE
def from_material(
    m: Material[_pd.types.ParameterFlavorT],
    reduction_method: (
        typing.Literal["remove-components", "force"] | None
    ) = None,
) -> typing.Self: ...
ARGUMENTS
Required
m
Type:Material[_pd.types.ParameterFlavorT]
Description:
Material to transform.
Optional
reduction_method
Type:typing.Literal['remove-components', 'force'] | None
Default value:None
Description:
Method to move between incompatible symmetry classes. None will only move to symmetries that are equal or more permissive, while remove-components will drop components that are found to match the new material's constraints as necessary, and thus leading to loss of free parameters but not of information. The option "force" will take all information necessary to construct the new parameter set without verification, leading to loss of information.
AzimuthDip.from_params()
Construct this material from generic parameters.
SIGNATURE
def from_params(
    azimuth: _pd.types.ParameterInput, dip: _pd.types.ParameterInput
) -> typing.Self: ...
ARGUMENTS
Required
azimuth
Type:_pd.types.ParameterInput
Description:
Azimuth away from X (towards Y) in degrees.
Required
dip
Type:_pd.types.ParameterInput
Description:
Dip away from vertical in degrees.
AzimuthDip.material_system()
Method that will return the material system of material.
SIGNATURE
def material_system() -> type[Material]: ...

Methods

AzimuthDip.generate_rotation_matrix()
Create the rotation matrix for this orientation material.
SIGNATURE
def generate_rotation_matrix(self) -> npt.NDArray: ...
AzimuthDip.get_basis_vector()
Gets one of the local basis vectors.
SIGNATURE
def get_basis_vector(
    self, axis: typing.Literal["local_X", "local_Y", "local_Z"]
) -> npt.NDArray: ...
ARGUMENTS
Required
axis
Type:typing.Literal['local_X', 'local_Y', 'local_Z']
Description:
The local basis vector to get.
AzimuthDip.get_basis_vectors()
Get local basis vectors for a material expressed in global coordinates.
SIGNATURE
def get_basis_vectors(
    self,
) -> tuple[npt.NDArray, npt.NDArray, npt.NDArray]: ...
AzimuthDip.map()
Generic map for dataclass instances.
f should be a function taking two parameters: the name of the dataclass member and its value, and it should return a tuple containing the same quantities. If a member is not to be transformed, f should just return a tuple of the input member name and value, unchanged. Both names and values can be transformed, with the semantics following those of dataclasses.replace.
In Salvus we primarily treat dataclasses as containers offering semantics similar to typed dictionaries. Deriving from this protocol allows any relevant dataclass to additionally be treated functorially. This allows for the generic un- and re-wrapping of value held in dataclasses, and essentially replaces the following imperative code:
@dataclass
class A:
    member: int

# Before
my_a = A(member=1)
my_a_new = dataclasses.replace(my_a, member=2 * my_a.member)

# After
my_a_new = A(val=1).map(lambda key, val: (key, 2 * val))
As with many functional patterns, the perceived benefits for simple demonstrative purposes is minimal. The scalability of this pattern becomes apparent, however, when parsing deeply nested abstractions, as the transformation logic can be factored out into independent functions. This is used extensively, for example, in the realization logic of the layered mesher, where generic materials can have generic parameters, etc.
SIGNATURE
def map(
    self, f: typing.Callable[[str, typing.Any], tuple[str, typing.Any]]
) -> typing.Self: ...
ARGUMENTS
Required
f
Type:typing.Callable[[str, typing.Any], tuple[str, typing.Any]]
Description:
The function to map over the dataclass.
AzimuthDip.map_realized_parameters()
Apply functions to each parameter individually, distinguishing _pd.
Useful when one wants to transform each parameter type separately. For instance, transformations of discrete parameters often require more associated logic than their constant equivalents. This function abstracts away the boilerplate of check for each parameter type, and subsequently transforming it with some function, as well as ensuring that the parameters are indeed of the correct realized type.
The signatures of each transformation function should take the parameter's name and value as two distinct inputs, and return the (potentially modified) parameter value.
SIGNATURE
def map_realized_parameters(
    self,
    f_constant: typing.Callable[
        [str, _pd.realized.constant.Parameter], _pd.realized.constant.Parameter
    ] = salvus.material.base_materials._map_realized_default,
    f_discrete: typing.Callable[
        [str, _pd.realized.discrete.Parameter], _pd.realized.discrete.Parameter
    ] = salvus.material.base_materials._map_realized_default,
    f_analytic: typing.Callable[
        [str, _pd.realized.analytic.Parameter], _pd.realized.analytic.Parameter
    ] = salvus.material.base_materials._map_realized_default,
) -> Self: ...
ARGUMENTS
Optional
f_constant
Type:typing.Callable[[str, _pd.realized.constant.Parameter], _pd.realized.constant.Parameter]
Default value:salvus.material.base_materials._map_realized_default
Description:
The function to apply to constant parameters. Defaults to returning the parameter as-is.
Optional
f_discrete
Type:typing.Callable[[str, _pd.realized.discrete.Parameter], _pd.realized.discrete.Parameter]
Default value:salvus.material.base_materials._map_realized_default
Description:
The function to apply to discrete parameters. Defaults to returning the parameter as-is.
Optional
f_analytic
Type:typing.Callable[[str, _pd.realized.analytic.Parameter], _pd.realized.analytic.Parameter]
Default value:salvus.material.base_materials._map_realized_default
Description:
The function to apply to analytic parameters. Defaults to returning the parameter as-is.
AzimuthDip.qc_test()
Run a series of material quality control tests.
The function also prints a summary of the issues found, including their severity and any mitigation steps that can be taken.
SIGNATURE
def qc_test(
    self,
    level: validation.QCLevel | str = QCLevel.strict,
    display_issues: bool = True,
) -> dict[str, MaterialQCIssue]: ...
ARGUMENTS
Optional
level
Type:validation.QCLevel | str
Default value:QCLevel.strict
Description:
The level of quality control to perform. The BASIC level performs minimal checks, while the STRICT level performs more thorough checks that are potentially slow. One can pass an enumeration value or a string representation of the level.
Optional
display_issues
Type:bool
Default value:True
Description:
If True, prints the issues found during the quality control checks. If False, issues are collected but not printed.
AzimuthDip.to_json()
Serialize the object to a dictionary that can be written to JSON.
SIGNATURE
def to_json(
    self,
    external_file_hash: types = None,
    timer: types = None,
    log_to_logger: bool = False,
    comm: types = None,
) -> builtins.dict: ...
ARGUMENTS
Optional
external_file_hash
Type:types
Default value:None
Description:
Hash of any external files associated with this object. Can be passed here in which case it will be stored in a centralized location in the JSON file.
Optional
timer
Type:types
Default value:None
Description:
Execution timer.
Optional
log_to_logger
Type:bool
Default value:False
Description:
Log timings to the logger.
Optional
comm
Type:types
Default value:None
Description:
MPI communicator, if any.
AzimuthDip.to_wavelength_oracle()
The wavelength oracle.
SIGNATURE
def to_wavelength_oracle(
    self, n_dim: typing.Literal[2, 3] | None = None
) -> _pd.types.ParameterOrConstantT: ...
ARGUMENTS
Optional
n_dim
Type:typing.Literal[2, 3] | None
Default value:None
Description:
Dimension to return the oracle for, deprecated.
AzimuthDip.with_orientation()
Experimetal method to add orientation to a material.
SIGNATURE
def with_orientation(self, orientation: Material | None) -> Material: ...
ARGUMENTS
Required
orientation
Type:Material | None
Description:
The orientation.

AzimuthDipRake

An orientation material parameterized by dip, azimuth and rake.
Rake is the intrinsic rotation in degrees about the local Z in the tilt plane. It describes the direction of local X and Y with respect to the strike, i.e. the line on the dipping plane which runs horizontal. It can be understood by "looking" along the azimuthal direction towards the "down" direction. With a rake of 0, this direction is the local X, and to the left (along the horizontal strike of the plane) is the local Y. Rake is measured anticlockwise from this frame (i.e. from local X towards local Y). X being aligned exactly horizontally to the left when looking down the dip plane corresponds to a rake of 90. In global coordinates, the projection of local X and global X have an angle of azimuth + rake.
SIGNATURE
class AzimuthDipRake(salvus.material.orientation._OrientedMaterial):
    def __init__(
        self,
        AZIMUTH: _pd.types.ParameterOrConstantT,
        DIP: _pd.types.ParameterOrConstantT,
        RAKE: _pd.types.ParameterOrConstantT,
    ) -> None: ...
ARGUMENTS
Required
AZIMUTH
Type:_pd.types.ParameterOrConstantT
Description:
Azimuth away from X (towards Y) in degrees.
Required
DIP
Type:_pd.types.ParameterOrConstantT
Description:
Dip away from vertical in degrees.
Required
RAKE
Type:_pd.types.ParameterOrConstantT
Description:
Rake that local X makes away from straight down the dipplane in degrees. 0 is straight down the dip plane, 90 is horizontal to the left (anticlockwise) of the dip plane, when looking down the dip plane. This is an intrinsic angle, and the direction of local X and Y will be determined by the combination of azimuth and rake.

Properties

  • ds(typing.Mapping)-Material's xarray representation.
  • flatten(dict)-Get all parameters as a dict.

Class Methods

AzimuthDipRake.from_dataset()
Construct a material from an xarray Dataset.
SIGNATURE
def from_dataset(ds: xr.Dataset) -> Material[_pd.types.ParameterFlavorT]: ...
ARGUMENTS
Required
ds
Type:xr.Dataset
Description:
The dataset to construct the material from.
AzimuthDipRake.from_json()
Recreate the object from a dictionary serialization of its initialization parameters.
SIGNATURE
def from_json(d: builtins.dict) -> Any: ...
ARGUMENTS
Required
d
Type:builtins.dict
Description:
Dictionary containing its init parameters and a few other things.
AzimuthDipRake.from_material()
Construct this material from another within the same physical system.
SIGNATURE
def from_material(
    m: Material[_pd.types.ParameterFlavorT],
    reduction_method: (
        typing.Literal["remove-components", "force"] | None
    ) = None,
) -> typing.Self: ...
ARGUMENTS
Required
m
Type:Material[_pd.types.ParameterFlavorT]
Description:
Material to transform.
Optional
reduction_method
Type:typing.Literal['remove-components', 'force'] | None
Default value:None
Description:
Method to move between incompatible symmetry classes. None will only move to symmetries that are equal or more permissive, while remove-components will drop components that are found to match the new material's constraints as necessary, and thus leading to loss of free parameters but not of information. The option "force" will take all information necessary to construct the new parameter set without verification, leading to loss of information.
AzimuthDipRake.from_params()
Construct this material from generic parameters.
SIGNATURE
def from_params(
    azimuth: _pd.types.ParameterInput,
    dip: _pd.types.ParameterInput,
    rake: _pd.types.ParameterInput,
) -> typing.Self: ...
ARGUMENTS
Required
azimuth
Type:_pd.types.ParameterInput
Description:
Azimuth away from global X (towards Y) in degrees.
Required
dip
Type:_pd.types.ParameterInput
Description:
Dip away from vertical in degrees.
Required
rake
Type:_pd.types.ParameterInput
Description:
Rake that local X makes away from straight down the dipplane in degrees. 0 is straight down the dip plane, 90 is horizontal to the left (anticlockwise) of the dip plane, when looking down the dip plane.
AzimuthDipRake.material_system()
Method that will return the material system of material.
SIGNATURE
def material_system() -> type[Material]: ...

Methods

AzimuthDipRake.generate_rotation_matrix()
Create the rotation matrix for this orientation material.
SIGNATURE
def generate_rotation_matrix(self) -> npt.NDArray: ...
AzimuthDipRake.get_basis_vector()
Gets one of the local basis vectors.
SIGNATURE
def get_basis_vector(
    self, axis: typing.Literal["local_X", "local_Y", "local_Z"]
) -> npt.NDArray: ...
ARGUMENTS
Required
axis
Type:typing.Literal['local_X', 'local_Y', 'local_Z']
Description:
The local basis vector to get.
AzimuthDipRake.get_basis_vectors()
Get local basis vectors for a material expressed in global coordinates.
SIGNATURE
def get_basis_vectors(
    self,
) -> tuple[npt.NDArray, npt.NDArray, npt.NDArray]: ...
AzimuthDipRake.map()
Generic map for dataclass instances.
f should be a function taking two parameters: the name of the dataclass member and its value, and it should return a tuple containing the same quantities. If a member is not to be transformed, f should just return a tuple of the input member name and value, unchanged. Both names and values can be transformed, with the semantics following those of dataclasses.replace.
In Salvus we primarily treat dataclasses as containers offering semantics similar to typed dictionaries. Deriving from this protocol allows any relevant dataclass to additionally be treated functorially. This allows for the generic un- and re-wrapping of value held in dataclasses, and essentially replaces the following imperative code:
@dataclass
class A:
    member: int

# Before
my_a = A(member=1)
my_a_new = dataclasses.replace(my_a, member=2 * my_a.member)

# After
my_a_new = A(val=1).map(lambda key, val: (key, 2 * val))
As with many functional patterns, the perceived benefits for simple demonstrative purposes is minimal. The scalability of this pattern becomes apparent, however, when parsing deeply nested abstractions, as the transformation logic can be factored out into independent functions. This is used extensively, for example, in the realization logic of the layered mesher, where generic materials can have generic parameters, etc.
SIGNATURE
def map(
    self, f: typing.Callable[[str, typing.Any], tuple[str, typing.Any]]
) -> typing.Self: ...
ARGUMENTS
Required
f
Type:typing.Callable[[str, typing.Any], tuple[str, typing.Any]]
Description:
The function to map over the dataclass.
AzimuthDipRake.map_realized_parameters()
Apply functions to each parameter individually, distinguishing _pd.
Useful when one wants to transform each parameter type separately. For instance, transformations of discrete parameters often require more associated logic than their constant equivalents. This function abstracts away the boilerplate of check for each parameter type, and subsequently transforming it with some function, as well as ensuring that the parameters are indeed of the correct realized type.
The signatures of each transformation function should take the parameter's name and value as two distinct inputs, and return the (potentially modified) parameter value.
SIGNATURE
def map_realized_parameters(
    self,
    f_constant: typing.Callable[
        [str, _pd.realized.constant.Parameter], _pd.realized.constant.Parameter
    ] = salvus.material.base_materials._map_realized_default,
    f_discrete: typing.Callable[
        [str, _pd.realized.discrete.Parameter], _pd.realized.discrete.Parameter
    ] = salvus.material.base_materials._map_realized_default,
    f_analytic: typing.Callable[
        [str, _pd.realized.analytic.Parameter], _pd.realized.analytic.Parameter
    ] = salvus.material.base_materials._map_realized_default,
) -> Self: ...
ARGUMENTS
Optional
f_constant
Type:typing.Callable[[str, _pd.realized.constant.Parameter], _pd.realized.constant.Parameter]
Default value:salvus.material.base_materials._map_realized_default
Description:
The function to apply to constant parameters. Defaults to returning the parameter as-is.
Optional
f_discrete
Type:typing.Callable[[str, _pd.realized.discrete.Parameter], _pd.realized.discrete.Parameter]
Default value:salvus.material.base_materials._map_realized_default
Description:
The function to apply to discrete parameters. Defaults to returning the parameter as-is.
Optional
f_analytic
Type:typing.Callable[[str, _pd.realized.analytic.Parameter], _pd.realized.analytic.Parameter]
Default value:salvus.material.base_materials._map_realized_default
Description:
The function to apply to analytic parameters. Defaults to returning the parameter as-is.
AzimuthDipRake.qc_test()
Run a series of material quality control tests.
The function also prints a summary of the issues found, including their severity and any mitigation steps that can be taken.
SIGNATURE
def qc_test(
    self,
    level: validation.QCLevel | str = QCLevel.strict,
    display_issues: bool = True,
) -> dict[str, MaterialQCIssue]: ...
ARGUMENTS
Optional
level
Type:validation.QCLevel | str
Default value:QCLevel.strict
Description:
The level of quality control to perform. The BASIC level performs minimal checks, while the STRICT level performs more thorough checks that are potentially slow. One can pass an enumeration value or a string representation of the level.
Optional
display_issues
Type:bool
Default value:True
Description:
If True, prints the issues found during the quality control checks. If False, issues are collected but not printed.
AzimuthDipRake.to_json()
Serialize the object to a dictionary that can be written to JSON.
SIGNATURE
def to_json(
    self,
    external_file_hash: types = None,
    timer: types = None,
    log_to_logger: bool = False,
    comm: types = None,
) -> builtins.dict: ...
ARGUMENTS
Optional
external_file_hash
Type:types
Default value:None
Description:
Hash of any external files associated with this object. Can be passed here in which case it will be stored in a centralized location in the JSON file.
Optional
timer
Type:types
Default value:None
Description:
Execution timer.
Optional
log_to_logger
Type:bool
Default value:False
Description:
Log timings to the logger.
Optional
comm
Type:types
Default value:None
Description:
MPI communicator, if any.
AzimuthDipRake.to_wavelength_oracle()
The wavelength oracle.
SIGNATURE
def to_wavelength_oracle(
    self, n_dim: typing.Literal[2, 3] | None = None
) -> _pd.types.ParameterOrConstantT: ...
ARGUMENTS
Optional
n_dim
Type:typing.Literal[2, 3] | None
Default value:None
Description:
Dimension to return the oracle for, deprecated.
AzimuthDipRake.with_orientation()
Experimetal method to add orientation to a material.
SIGNATURE
def with_orientation(self, orientation: Material | None) -> Material: ...
ARGUMENTS
Required
orientation
Type:Material | None
Description:
The orientation.

ClockwiseAngle

An orientation material parameterized by a clockwise rotation angle.
Only useful for 2-D materials.
SIGNATURE
class ClockwiseAngle(salvus.material.orientation._OrientedMaterial):
    def __init__(
        self, ANGLE_IN_DEGREES: _pd.types.ParameterOrConstantT
    ) -> None: ...
ARGUMENTS
Required
ANGLE_IN_DEGREES
Type:_pd.types.ParameterOrConstantT
Description:
The clockwise rotation angle in degree.

Properties

  • ds(typing.Mapping)-Material's xarray representation.
  • flatten(dict)-Get all parameters as a dict.

Class Methods

ClockwiseAngle.from_dataset()
Construct a material from an xarray Dataset.
SIGNATURE
def from_dataset(ds: xr.Dataset) -> Material[_pd.types.ParameterFlavorT]: ...
ARGUMENTS
Required
ds
Type:xr.Dataset
Description:
The dataset to construct the material from.
ClockwiseAngle.from_json()
Recreate the object from a dictionary serialization of its initialization parameters.
SIGNATURE
def from_json(d: builtins.dict) -> Any: ...
ARGUMENTS
Required
d
Type:builtins.dict
Description:
Dictionary containing its init parameters and a few other things.
ClockwiseAngle.from_material()
Construct this material from another within the same physical system.
SIGNATURE
def from_material(
    m: Material[_pd.types.ParameterFlavorT],
    reduction_method: (
        typing.Literal["remove-components", "force"] | None
    ) = None,
) -> typing.Self: ...
ARGUMENTS
Required
m
Type:Material[_pd.types.ParameterFlavorT]
Description:
Material to transform.
Optional
reduction_method
Type:typing.Literal['remove-components', 'force'] | None
Default value:None
Description:
Method to move between incompatible symmetry classes. None will only move to symmetries that are equal or more permissive, while remove-components will drop components that are found to match the new material's constraints as necessary, and thus leading to loss of free parameters but not of information. The option "force" will take all information necessary to construct the new parameter set without verification, leading to loss of information.
ClockwiseAngle.from_params()
Construct this material from generic parameters.
SIGNATURE
def from_params(angle_in_degrees: _pd.types.ParameterInput) -> typing.Self: ...
ARGUMENTS
Required
angle_in_degrees
Type:_pd.types.ParameterInput
Description:
The clockwise rotation angle in degree.
ClockwiseAngle.material_system()
Method that will return the material system of material.
SIGNATURE
def material_system() -> type[Material]: ...

Methods

ClockwiseAngle.generate_rotation_matrix()
Create the rotation matrix for this orientation material.
SIGNATURE
def generate_rotation_matrix(self) -> npt.NDArray: ...
ClockwiseAngle.get_basis_vector()
Gets one of the local basis vectors.
SIGNATURE
def get_basis_vector(
    self, axis: typing.Literal["local_X", "local_Y", "local_Z"]
) -> npt.NDArray: ...
ARGUMENTS
Required
axis
Type:typing.Literal['local_X', 'local_Y', 'local_Z']
Description:
The local basis vector to get.
ClockwiseAngle.get_basis_vectors()
Get local basis vectors for a material expressed in global coordinates.
SIGNATURE
def get_basis_vectors(
    self,
) -> tuple[npt.NDArray, npt.NDArray, npt.NDArray]: ...
ClockwiseAngle.map()
Generic map for dataclass instances.
f should be a function taking two parameters: the name of the dataclass member and its value, and it should return a tuple containing the same quantities. If a member is not to be transformed, f should just return a tuple of the input member name and value, unchanged. Both names and values can be transformed, with the semantics following those of dataclasses.replace.
In Salvus we primarily treat dataclasses as containers offering semantics similar to typed dictionaries. Deriving from this protocol allows any relevant dataclass to additionally be treated functorially. This allows for the generic un- and re-wrapping of value held in dataclasses, and essentially replaces the following imperative code:
@dataclass
class A:
    member: int

# Before
my_a = A(member=1)
my_a_new = dataclasses.replace(my_a, member=2 * my_a.member)

# After
my_a_new = A(val=1).map(lambda key, val: (key, 2 * val))
As with many functional patterns, the perceived benefits for simple demonstrative purposes is minimal. The scalability of this pattern becomes apparent, however, when parsing deeply nested abstractions, as the transformation logic can be factored out into independent functions. This is used extensively, for example, in the realization logic of the layered mesher, where generic materials can have generic parameters, etc.
SIGNATURE
def map(
    self, f: typing.Callable[[str, typing.Any], tuple[str, typing.Any]]
) -> typing.Self: ...
ARGUMENTS
Required
f
Type:typing.Callable[[str, typing.Any], tuple[str, typing.Any]]
Description:
The function to map over the dataclass.
ClockwiseAngle.map_realized_parameters()
Apply functions to each parameter individually, distinguishing _pd.
Useful when one wants to transform each parameter type separately. For instance, transformations of discrete parameters often require more associated logic than their constant equivalents. This function abstracts away the boilerplate of check for each parameter type, and subsequently transforming it with some function, as well as ensuring that the parameters are indeed of the correct realized type.
The signatures of each transformation function should take the parameter's name and value as two distinct inputs, and return the (potentially modified) parameter value.
SIGNATURE
def map_realized_parameters(
    self,
    f_constant: typing.Callable[
        [str, _pd.realized.constant.Parameter], _pd.realized.constant.Parameter
    ] = salvus.material.base_materials._map_realized_default,
    f_discrete: typing.Callable[
        [str, _pd.realized.discrete.Parameter], _pd.realized.discrete.Parameter
    ] = salvus.material.base_materials._map_realized_default,
    f_analytic: typing.Callable[
        [str, _pd.realized.analytic.Parameter], _pd.realized.analytic.Parameter
    ] = salvus.material.base_materials._map_realized_default,
) -> Self: ...
ARGUMENTS
Optional
f_constant
Type:typing.Callable[[str, _pd.realized.constant.Parameter], _pd.realized.constant.Parameter]
Default value:salvus.material.base_materials._map_realized_default
Description:
The function to apply to constant parameters. Defaults to returning the parameter as-is.
Optional
f_discrete
Type:typing.Callable[[str, _pd.realized.discrete.Parameter], _pd.realized.discrete.Parameter]
Default value:salvus.material.base_materials._map_realized_default
Description:
The function to apply to discrete parameters. Defaults to returning the parameter as-is.
Optional
f_analytic
Type:typing.Callable[[str, _pd.realized.analytic.Parameter], _pd.realized.analytic.Parameter]
Default value:salvus.material.base_materials._map_realized_default
Description:
The function to apply to analytic parameters. Defaults to returning the parameter as-is.
ClockwiseAngle.qc_test()
Run a series of material quality control tests.
The function also prints a summary of the issues found, including their severity and any mitigation steps that can be taken.
SIGNATURE
def qc_test(
    self,
    level: validation.QCLevel | str = QCLevel.strict,
    display_issues: bool = True,
) -> dict[str, MaterialQCIssue]: ...
ARGUMENTS
Optional
level
Type:validation.QCLevel | str
Default value:QCLevel.strict
Description:
The level of quality control to perform. The BASIC level performs minimal checks, while the STRICT level performs more thorough checks that are potentially slow. One can pass an enumeration value or a string representation of the level.
Optional
display_issues
Type:bool
Default value:True
Description:
If True, prints the issues found during the quality control checks. If False, issues are collected but not printed.
ClockwiseAngle.to_json()
Serialize the object to a dictionary that can be written to JSON.
SIGNATURE
def to_json(
    self,
    external_file_hash: types = None,
    timer: types = None,
    log_to_logger: bool = False,
    comm: types = None,
) -> builtins.dict: ...
ARGUMENTS
Optional
external_file_hash
Type:types
Default value:None
Description:
Hash of any external files associated with this object. Can be passed here in which case it will be stored in a centralized location in the JSON file.
Optional
timer
Type:types
Default value:None
Description:
Execution timer.
Optional
log_to_logger
Type:bool
Default value:False
Description:
Log timings to the logger.
Optional
comm
Type:types
Default value:None
Description:
MPI communicator, if any.
ClockwiseAngle.to_wavelength_oracle()
The wavelength oracle.
SIGNATURE
def to_wavelength_oracle(
    self, n_dim: typing.Literal[2, 3] | None = None
) -> _pd.types.ParameterOrConstantT: ...
ARGUMENTS
Optional
n_dim
Type:typing.Literal[2, 3] | None
Default value:None
Description:
Dimension to return the oracle for, deprecated.
ClockwiseAngle.with_orientation()
Experimetal method to add orientation to a material.
SIGNATURE
def with_orientation(self, orientation: Material | None) -> Material: ...
ARGUMENTS
Required
orientation
Type:Material | None
Description:
The orientation.

DirectOrthonormalBasis

Orientation given directly by an orthonormal basis matrix.
The basis vectors are given in the order local_X, local_Y, local_Z. The basis vectors are assumed to be orthonormal and right-handed. The orientation is given by the rotation matrix that transforms the global basis vectors to the local basis vectors.
By default, Gram-Schmidt (GS) orthonormalization is applied to the input vectors to ensure they are orthonormal and right-handed, even if the input vectors are only approximately so (e.g., due to numerical error). This is recommended unless you are certain your input vectors are already exactly orthonormal and right-handed, in which case you can disable GS by setting skip_orthonormalization=True on various constructors for improved performance and to preserve the original vectors exactly.
  • If GS is enabled (the default), the input vectors will be orthonormalized in the order local_X, local_Y, local_Z.
  • If GS is disabled, the input vectors are used as-is, and it is the caller's responsibility to ensure they are orthonormal and right-handed.
SIGNATURE
class DirectOrthonormalBasis(salvus.material.orientation._OrientedMaterial):
    def __init__(
        self,
        M00: _pd.types.ParameterOrConstantT,
        M01: _pd.types.ParameterOrConstantT,
        M02: _pd.types.ParameterOrConstantT,
        M10: _pd.types.ParameterOrConstantT,
        M11: _pd.types.ParameterOrConstantT,
        M12: _pd.types.ParameterOrConstantT,
        M20: _pd.types.ParameterOrConstantT,
        M21: _pd.types.ParameterOrConstantT,
        M22: _pd.types.ParameterOrConstantT,
    ) -> None: ...
ARGUMENTS
Required
M00
Type:_pd.types.ParameterOrConstantT
Description:
The first component of the first basis vector.
Required
M01
Type:_pd.types.ParameterOrConstantT
Description:
The second component of the first basis vector.
Required
M02
Type:_pd.types.ParameterOrConstantT
Description:
The third component of the first basis vector.
Required
M10
Type:_pd.types.ParameterOrConstantT
Description:
The first component of the second basis vector.
Required
M11
Type:_pd.types.ParameterOrConstantT
Description:
The second component of the second basis vector.
Required
M12
Type:_pd.types.ParameterOrConstantT
Description:
The third component of the second basis vector.
Required
M20
Type:_pd.types.ParameterOrConstantT
Description:
The first component of the third basis vector.
Required
M21
Type:_pd.types.ParameterOrConstantT
Description:
The second component of the third basis vector.
Required
M22
Type:_pd.types.ParameterOrConstantT
Description:
The third component of the third basis vector.

Properties

  • ds(typing.Mapping)-Material's xarray representation.
  • flatten(dict)-Get all parameters as a dict.

Class Methods

DirectOrthonormalBasis.from_array()
Construct this material from a 3x3 matrix or array of matrices.
SIGNATURE
def from_array(
    matrix: npt.NDArray, skip_orthonormalization: bool = False
) -> typing.Self: ...
ARGUMENTS
Required
matrix
Type:npt.NDArray
Description:
A 3x3 matrix or array of matrices that represent the local basis vectors.
Optional
skip_orthonormalization
Type:bool
Default value:False
Description:
If True, the Gram-Schmidt orthonormalization procedure is skipped. This is useful if one is sure that the input vectors are already orthonormal. If False, the Gram-Schmidt orthonormalization procedure is applied to the input vectors. Gram-Schmidt orthonormalization applied in m0, m1, m2 order.
DirectOrthonormalBasis.from_basis_vectors()
Construct from three orthonormal basis vectors.
SIGNATURE
def from_basis_vectors(
    local_x: npt.NDArray,
    local_y: npt.NDArray,
    local_z: npt.NDArray,
    skip_orthonormalization: bool = False,
) -> typing.Self: ...
ARGUMENTS
Required
local_x
Type:npt.NDArray
Description:
The first basis vector.
Required
local_y
Type:npt.NDArray
Description:
The second basis vector.
Required
local_z
Type:npt.NDArray
Description:
The third basis vector.
Optional
skip_orthonormalization
Type:bool
Default value:False
Description:
If True, the Gram-Schmidt orthonormalization procedure is skipped. This is useful if one is sure that the input vectors are already orthonormal. If False, the Gram-Schmidt orthonormalization procedure is applied to the input vectors. Gram-Schmidt orthonormalization applied in m0, m1, m2 order.
DirectOrthonormalBasis.from_dataset()
Construct a material from an xarray Dataset.
SIGNATURE
def from_dataset(ds: xr.Dataset) -> Material[_pd.types.ParameterFlavorT]: ...
ARGUMENTS
Required
ds
Type:xr.Dataset
Description:
The dataset to construct the material from.
DirectOrthonormalBasis.from_json()
Recreate the object from a dictionary serialization of its initialization parameters.
SIGNATURE
def from_json(d: builtins.dict) -> Any: ...
ARGUMENTS
Required
d
Type:builtins.dict
Description:
Dictionary containing its init parameters and a few other things.
DirectOrthonormalBasis.from_material()
Construct this material from another within the same physical system.
SIGNATURE
def from_material(
    m: Material[_pd.types.ParameterFlavorT],
    reduction_method: (
        typing.Literal["remove-components", "force"] | None
    ) = None,
) -> typing.Self: ...
ARGUMENTS
Required
m
Type:Material[_pd.types.ParameterFlavorT]
Description:
Material to transform.
Optional
reduction_method
Type:typing.Literal['remove-components', 'force'] | None
Default value:None
Description:
Method to move between incompatible symmetry classes. None will only move to symmetries that are equal or more permissive, while remove-components will drop components that are found to match the new material's constraints as necessary, and thus leading to loss of free parameters but not of information. The option "force" will take all information necessary to construct the new parameter set without verification, leading to loss of information.
DirectOrthonormalBasis.from_params()
Construct from nine scalar matrix components.
SIGNATURE
def from_params(
    m00: _pd.types.ParameterInput,
    m01: _pd.types.ParameterInput,
    m02: _pd.types.ParameterInput,
    m10: _pd.types.ParameterInput,
    m11: _pd.types.ParameterInput,
    m12: _pd.types.ParameterInput,
    m20: _pd.types.ParameterInput,
    m21: _pd.types.ParameterInput,
    m22: _pd.types.ParameterInput,
    skip_orthonormalization: bool = False,
) -> typing.Self: ...
ARGUMENTS
Required
m00
Type:_pd.types.ParameterInput
Description:
The first component of the first basis vector.
Required
m01
Type:_pd.types.ParameterInput
Description:
The second component of the first basis vector.
Required
m02
Type:_pd.types.ParameterInput
Description:
The third component of the first basis vector.
Required
m10
Type:_pd.types.ParameterInput
Description:
The first component of the second basis vector.
Required
m11
Type:_pd.types.ParameterInput
Description:
The second component of the second basis vector.
Required
m12
Type:_pd.types.ParameterInput
Description:
The third component of the second basis vector.
Required
m20
Type:_pd.types.ParameterInput
Description:
The first component of the third basis vector.
Required
m21
Type:_pd.types.ParameterInput
Description:
The second component of the third basis vector.
Required
m22
Type:_pd.types.ParameterInput
Description:
The third component of the third basis vector.
Optional
skip_orthonormalization
Type:bool
Default value:False
Description:
If True, the Gram-Schmidt orthonormalization procedure is skipped. This is useful if one is sure that the input vectors are already orthonormal. If False, the Gram-Schmidt orthonormalization procedure is applied to the input vectors. Gram-Schmidt orthonormalization applied in m0, m1, m2 order.
DirectOrthonormalBasis.material_system()
Method that will return the material system of material.
SIGNATURE
def material_system() -> type[Material]: ...

Methods

DirectOrthonormalBasis.generate_rotation_matrix()
Reconstruct the rotation matrix from stored components.
SIGNATURE
def generate_rotation_matrix(self) -> npt.NDArray: ...
DirectOrthonormalBasis.get_basis_vector()
Gets one of the local basis vectors.
SIGNATURE
def get_basis_vector(
    self, axis: typing.Literal["local_X", "local_Y", "local_Z"]
) -> npt.NDArray: ...
ARGUMENTS
Required
axis
Type:typing.Literal['local_X', 'local_Y', 'local_Z']
Description:
The local basis vector to get.
DirectOrthonormalBasis.get_basis_vectors()
Get local basis vectors for a material expressed in global coordinates.
SIGNATURE
def get_basis_vectors(
    self,
) -> tuple[npt.NDArray, npt.NDArray, npt.NDArray]: ...
DirectOrthonormalBasis.map()
Generic map for dataclass instances.
f should be a function taking two parameters: the name of the dataclass member and its value, and it should return a tuple containing the same quantities. If a member is not to be transformed, f should just return a tuple of the input member name and value, unchanged. Both names and values can be transformed, with the semantics following those of dataclasses.replace.
In Salvus we primarily treat dataclasses as containers offering semantics similar to typed dictionaries. Deriving from this protocol allows any relevant dataclass to additionally be treated functorially. This allows for the generic un- and re-wrapping of value held in dataclasses, and essentially replaces the following imperative code:
@dataclass
class A:
    member: int

# Before
my_a = A(member=1)
my_a_new = dataclasses.replace(my_a, member=2 * my_a.member)

# After
my_a_new = A(val=1).map(lambda key, val: (key, 2 * val))
As with many functional patterns, the perceived benefits for simple demonstrative purposes is minimal. The scalability of this pattern becomes apparent, however, when parsing deeply nested abstractions, as the transformation logic can be factored out into independent functions. This is used extensively, for example, in the realization logic of the layered mesher, where generic materials can have generic parameters, etc.
SIGNATURE
def map(
    self, f: typing.Callable[[str, typing.Any], tuple[str, typing.Any]]
) -> typing.Self: ...
ARGUMENTS
Required
f
Type:typing.Callable[[str, typing.Any], tuple[str, typing.Any]]
Description:
The function to map over the dataclass.
DirectOrthonormalBasis.map_realized_parameters()
Apply functions to each parameter individually, distinguishing _pd.
Useful when one wants to transform each parameter type separately. For instance, transformations of discrete parameters often require more associated logic than their constant equivalents. This function abstracts away the boilerplate of check for each parameter type, and subsequently transforming it with some function, as well as ensuring that the parameters are indeed of the correct realized type.
The signatures of each transformation function should take the parameter's name and value as two distinct inputs, and return the (potentially modified) parameter value.
SIGNATURE
def map_realized_parameters(
    self,
    f_constant: typing.Callable[
        [str, _pd.realized.constant.Parameter], _pd.realized.constant.Parameter
    ] = salvus.material.base_materials._map_realized_default,
    f_discrete: typing.Callable[
        [str, _pd.realized.discrete.Parameter], _pd.realized.discrete.Parameter
    ] = salvus.material.base_materials._map_realized_default,
    f_analytic: typing.Callable[
        [str, _pd.realized.analytic.Parameter], _pd.realized.analytic.Parameter
    ] = salvus.material.base_materials._map_realized_default,
) -> Self: ...
ARGUMENTS
Optional
f_constant
Type:typing.Callable[[str, _pd.realized.constant.Parameter], _pd.realized.constant.Parameter]
Default value:salvus.material.base_materials._map_realized_default
Description:
The function to apply to constant parameters. Defaults to returning the parameter as-is.
Optional
f_discrete
Type:typing.Callable[[str, _pd.realized.discrete.Parameter], _pd.realized.discrete.Parameter]
Default value:salvus.material.base_materials._map_realized_default
Description:
The function to apply to discrete parameters. Defaults to returning the parameter as-is.
Optional
f_analytic
Type:typing.Callable[[str, _pd.realized.analytic.Parameter], _pd.realized.analytic.Parameter]
Default value:salvus.material.base_materials._map_realized_default
Description:
The function to apply to analytic parameters. Defaults to returning the parameter as-is.
DirectOrthonormalBasis.qc_test()
Run a series of material quality control tests.
The function also prints a summary of the issues found, including their severity and any mitigation steps that can be taken.
SIGNATURE
def qc_test(
    self,
    level: validation.QCLevel | str = QCLevel.strict,
    display_issues: bool = True,
) -> dict[str, MaterialQCIssue]: ...
ARGUMENTS
Optional
level
Type:validation.QCLevel | str
Default value:QCLevel.strict
Description:
The level of quality control to perform. The BASIC level performs minimal checks, while the STRICT level performs more thorough checks that are potentially slow. One can pass an enumeration value or a string representation of the level.
Optional
display_issues
Type:bool
Default value:True
Description:
If True, prints the issues found during the quality control checks. If False, issues are collected but not printed.
DirectOrthonormalBasis.to_json()
Serialize the object to a dictionary that can be written to JSON.
SIGNATURE
def to_json(
    self,
    external_file_hash: types = None,
    timer: types = None,
    log_to_logger: bool = False,
    comm: types = None,
) -> builtins.dict: ...
ARGUMENTS
Optional
external_file_hash
Type:types
Default value:None
Description:
Hash of any external files associated with this object. Can be passed here in which case it will be stored in a centralized location in the JSON file.
Optional
timer
Type:types
Default value:None
Description:
Execution timer.
Optional
log_to_logger
Type:bool
Default value:False
Description:
Log timings to the logger.
Optional
comm
Type:types
Default value:None
Description:
MPI communicator, if any.
DirectOrthonormalBasis.to_wavelength_oracle()
The wavelength oracle.
SIGNATURE
def to_wavelength_oracle(
    self, n_dim: typing.Literal[2, 3] | None = None
) -> _pd.types.ParameterOrConstantT: ...
ARGUMENTS
Optional
n_dim
Type:typing.Literal[2, 3] | None
Default value:None
Description:
Dimension to return the oracle for, deprecated.
DirectOrthonormalBasis.with_orientation()
Experimetal method to add orientation to a material.
SIGNATURE
def with_orientation(self, orientation: Material | None) -> Material: ...
ARGUMENTS
Required
orientation
Type:Material | None
Description:
The orientation.
PAGE CONTENTS