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)[source]#

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

Parameters:
  • value (int | float | numpy.typing.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)[source]#

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

Parameters:
  • value (int | float | numpy.typing.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)[source]#

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

Parameters:
  • value (int | float | numpy.typing.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)[source]#

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. It enforces unit compatibility with the ontology.

Parameters:

Examples

>>> import mammos_entity as me
>>> import mammos_units as u
>>> Ms = me.Entity(ontology_label='SpontaneousMagnetization', value=8e5, unit='A / m')
>>> H = me.Entity("ExternalMagneticField", 1e4 * u.A / u.m)
>>> Tc_kK = me.Entity("CurieTemperature", 0.1, unit=u.kK)
>>> Tc_K = me.Entity("CurieTemperature", Tc_kK, unit=u.K)
property axis_label: str#

Return an ontology-based axis label for the plots.

The axis label consist of ontology label and unit: - The ontology label is split with spaces at all capital letters - The units are added in parentheses.

Returns:

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

Examples

>>> import mammos_entity as me
>>> me.Entity("SpontaneousMagnetization").axis_label
'Spontaneous Magnetization (A / m)'
>>> me.Entity("DemagnetizingFactor").axis_label
'Demagnetizing Factor'
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 q: mammos_units.Quantity#

Quantity attribute, shorthand for .quantity.

property quantity: astropy.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 unit: astropy.units.UnitBase#

Unit of the entity data.

property value: numpy.scalar | numpy.ndarray#

Numerical data of the entity.

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

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

Parameters:
  • value (int | float | numpy.typing.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)[source]#

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

Parameters:
  • value (int | float | numpy.typing.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 labeled “CoercivityHcExternal”.

Return type:

Entity

mammos_entity.J(value=0, unit=None)[source]#

Create an Entity representing the magnetic polarisation (J).

Parameters:
  • value (int | float | numpy.typing.ArrayLike) – Numeric value corresponding to magnetic polarisation. It can also be a Numpy array.

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

Returns:

An Entity object labeled “MagneticPolarisation”.

Return type:

mammos_entity.Entity

mammos_entity.Js(value=0, unit=None)[source]#

Create an Entity representing the spontaneous magnetic polarisation (Js).

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

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

Returns:

An Entity object labeled “SpontaneousMagneticPolarisation”.

Return type:

mammos_entity.Entity

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

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

Parameters:
  • value (int | float | numpy.typing.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)[source]#

Create an Entity representing the magnetization.

Parameters:
  • value (int | float | numpy.typing.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)[source]#

Create an Entity representing the remanent magnetisation (Mr).

Parameters:
  • value (int | float | numpy.typing.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)[source]#

Create an Entity representing the spontaneous magnetization (Ms).

Parameters:
  • value (int | float | numpy.typing.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)[source]#

Create an Entity representing the temperature (T).

Parameters:
  • value (int | float | numpy.typing.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)[source]#

Create an Entity representing the Curie temperature (Tc).

Parameters:
  • value (int | float | numpy.typing.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