mammos_entity#

Entity (Quantity and EMMO ontology label).

Exposes the primary components of the MaMMoS entity package, including the Entity class for ontology-linked physical quantities, pre-defined factory methods for common magnetic entities (Ms, A, Ku, H), and the loaded MaMMoS ontology object.

mammos_entity.A(value=0, unit=None)#

Create an Entity representing the exchange stiffness constant (A).

Parameters:
  • value (int | float | ArrayLike) – Numeric value corresponding to exchange stiffness. It can also be a Numpy array.

  • unit (None | str) – Unit of measure for the value (e.g., ‘J/m’). If omitted, the SI unit from the ontology, i.e. J/m, will be inferred.

Returns:

An Entity object labeled “ExchangeStiffnessConstant”.

Return type:

mammos_entity.Entity

mammos_entity.B(value=0, unit=None)#

Create an Entity representing the magnetic flux density (B).

Parameters:
  • value (int | float | ArrayLike) – Numeric value corresponding to the magnetic flux density. It can also be a Numpy array.

  • unit (None | str) – Unit of measure for the value (e.g., ‘T’). If omitted, the SI unit from the ontology, i.e. T, will be inferred.

Returns:

An Entity object labelled “MagneticFluxDensity”.

Return type:

mammos_entity.Entity

mammos_entity.BHmax(value=0, unit=None)#

Create an Entity representing the maximum energy product of the hysteresis loop.

Parameters:
  • value (int | float | ArrayLike) – Numeric value corresponding to the maximum energy product. It can also be a Numpy array.

  • unit (None | str) – Unit of measure for the value (e.g., ‘J/m3’). If omitted, the SI unit from the ontology, i.e. J/m3, will be inferred.

Returns:

An Entity object labelled “MaximumEnergyProduct”.

Return type:

mammos_entity.Entity

class mammos_entity.Entity(ontology_label, value=0, unit=None, **kwargs)#

Create a quantity (a value and a unit) linked to the EMMO ontology.

Represents a physical property or quantity that is linked to an ontology concept. Inherits from mammos_units.Quantity and enforces unit compatibility with the ontology.

Parameters:
  • ontology_label (str) – Ontology label

  • value (float | int | ArrayLike) – Value

  • unit (str | None) – Unit

Return type:

mammos_units.Quantity

Examples

>>> import mammos_entity as me
>>> m = me.Ms(800000, 'A/m')
>>> m
SpontaneousMagnetization(value=800000.0, unit=A / m)
property axis_label: str#

Return an ontology based axis label for the plots.

Returns:

A string for labelling the axis corresponding to the entity on a plot.

property ontology: owlready2.entity.ThingClass#

Retrieve the ontology class corresponding to the entity’s label.

Returns:

The ontology class from mammos_ontology that matches the entity’s label.

property ontology_label: str#

The ontology label that links the entity to the EMMO ontology.

Retrieve the ontology label corresponding to the ThingClass that defines the given entity in ontology.

Returns:

The ontology label corresponding to the right ThingClass.

Return type:

str

property ontology_label_with_iri: str#

The ontology label with its IRI. Unique link to EMMO ontology.

Returns the self.ontology_label together with the IRI (a URL that points to the definition of this entity.) IRI stands for Internationalized Resource Identifier.

If only the IRI is desired, one can use self.ontology.iri.

Returns:

The ontology label corresponding to the right ThingClass,

together with the IRI.

Return type:

str

property quantity: mammos_units.Quantity#

Return the entity as a mammos_units.Quantity.

Return a stand-alone mammos_units.Quantity object with the same value and unit, detached from the ontology link.

Returns:

A copy of this entity as a pure physical quantity.

property si: mammos_entity.Entity#

Return the entity in SI units.

Returns:

Entity in SI units.

to(*args, **kwargs)#

Modify the unit of the entity in accordance to the EMMO ontology.

Override method to convert from one unit to the other. If the coversion requires equivalencies, the method returns a astropy.unit.Quantity otherwise it returns an Entity with modified units.

Parameters:
  • unit – The string defining the target unit to convert to (e.g., ‘mJ/m’).

  • equivalencies – List of equivalencies to be used for unit conversion.

  • copy – If True, then the value is copied. Otherwise, a copy will only be made if necessary.

Returns:

mammos_units.Quantity if equivalencies are used to convert the units, mammos_entity.Entity if equivalencies are not used to convert the units.

Return type:

mammos_units.Quantity | mammos_entity.Entity

mammos_entity.H(value=0, unit=None)#

Create an Entity representing the external magnetic field (H).

Parameters:
  • value (int | float | ArrayLike) – Numeric value corresponding to the external magnetic field. It can also be a Numpy array.

  • unit (None | str) – Unit of measure for the value (e.g., ‘T’ for Tesla). If omitted, the SI unit from the ontology, i.e. T, will be inferred.

Returns:

An Entity object labeled “ExternalMagneticField”.

Return type:

Entity

mammos_entity.Hc(value=0, unit=None)#

Create an Entity representing the external coercive field (Hc).

Parameters:
  • value (int | float | ArrayLike) – Numeric value corresponding to the external coercive field. It can also be a Numpy array.

  • unit (None | str) – Unit of measure for the value (e.g., ‘A/m’). If omitted, the SI unit from the ontology, i.e. A/m, will be inferred.

Returns:

An Entity object labelled “CoercivityHcExternal”.

Return type:

Entity

mammos_entity.Ku(value=0, unit=None)#

Create an Entity representing the uniaxial anisotropy constant (Ku).

Parameters:
  • value (int | float | ArrayLike) – Numeric value corresponding to the uniaxial anisotropy constant. It can also be a Numpy array.

  • unit (None | str) – Unit of measure for the value (e.g., ‘J/m^3’). If omitted, the SI unit from the ontology, i.e. J/m^3 will be inferred.

Returns:

An Entity object labeled “UniaxialAnisotropyConstant”.

Return type:

mammos_entity.Entity

mammos_entity.M(value=0, unit=None)#

Create an Entity representing the magnetization.

Parameters:
  • value (int | float | ArrayLike) – Numeric value corresponding to the magnetization of the material. It can also be a Numpy array.

  • unit (None | str) – Unit of measure for the value (e.g., ‘A/m’). If omitted, the SI unit from the ontology, i.e. A/m, will be inferred.

Returns:

An Entity object labelled “Magnetization”.

Return type:

mammos_entity.Entity

mammos_entity.Mr(value=0, unit=None)#

Create an Entity representing the remanent magnetisation (Mr).

Parameters:
  • value (int | float | ArrayLike) – Numeric value corresponding to the remanent magnetisation. It can also be a Numpy array.

  • unit (None | str) – Unit of measure for the value (e.g., ‘A/m’). If omitted, the SI unit from the ontology, i.e. A/m, will be inferred.

Returns:

An Entity object labelled “Remanence”.

Return type:

mammos_entity.Entity

mammos_entity.Ms(value=0, unit=None)#

Create an Entity representing the spontaneous magnetization (Ms).

Parameters:
  • value (int | float | ArrayLike) – Numeric value corresponding to spontaneous magnetization. It can also be a Numpy array.

  • unit (None | str) – Unit of measure for the value (e.g., ‘A/m’). If omitted, the SI unit from the ontology, i.e. A/m, will be inferred.

Returns:

An Entity object labelled “SpontaneousMagnetization”.

Return type:

mammos_entity.Entity

mammos_entity.T(value=0, unit=None)#

Create an Entity representing the temperature (T).

Parameters:
  • value (int | float | ArrayLike) – Numeric value corresponding to the temperature. It can also be a Numpy array.

  • unit (None | str) – Unit of measure for the value (e.g., ‘K’). If omitted, the SI unit from the ontology, i.e. K, will be inferred.

Returns:

An Entity object labelled “ThermodynamicTemperature”.

Return type:

mammos_entity.Entity

mammos_entity.Tc(value=0, unit=None)#

Create an Entity representing the Curie temperature (Tc).

Parameters:
  • value (int | float | ArrayLike) – Numeric value corresponding to the Curie temperature. It can also be a Numpy array.

  • unit (None | str) – Unit of measure for the value (e.g., ‘K’ for Kelvin). If omitted, the SI unit from the ontology, i.e. K, will be inferred.

Returns:

An Entity object labelled “CurieTemperature”.

Return type:

mammos_entity.Entity