Base Module
- class beautifuljason.base.Alignment(*values)
Bases:
IntFlagRepresents alignment options, analogous to Qt’s Qt::AlignmentFlag.
- Absolute = 128
- Bottom = 32
- Center = 68
- HCenter = 4
- Justify = 8
- Leading = 1
- Left = 1
- Right = 2
- Top = 16
- Trailing = 2
- VCenter = 64
- _all_bits_ = 255
- _boundary_ = 'keep'
- _flag_mask_ = 255
- static _generate_next_value_(name, start, count, last_values)
Generate the next value when not given.
name: the name of the member start: the initial start value or None count: the number of existing members last_values: the last value assigned or None
- _inverted_ = None
- _singles_mask_ = 255
- class beautifuljason.base.AttrList(h5_group)
Bases:
H5GroupRepresents a list-like interface for attributes in an HDF5 group.
- Parameters:
h5_group (h5py.Group) – The actual HDF5 group object.
- class Iterator(h5_group, iter_start, iter_step)
Bases:
H5GroupIterator for the
AttrListclass.- Parameters:
h5_group (h5py.Group) – The actual HDF5 group object.
iter_start (
int) – The starting index for the iterator.iter_step (
int) – The step size for the iterator.
- append(values)
Appends the given values as attributes.
- Parameters:
values (
Sequence) – The values to append.
- class beautifuljason.base.DatasetList(h5_group)
Bases:
H5GroupAdded in version 1.2.0.
Represents a list-like interface for datasets in an HDF5 group, where dataset names are consecutive integers: ‘0’, ‘1’, ‘2’, …
- Parameters:
h5_group (h5py.Group) – The actual HDF5 group object.
- class Iterator(h5_group, iter_start, iter_step)
Bases:
H5GroupIterator for the
DatasetListclass.- Parameters:
h5_group (h5py.Group) – The actual HDF5 group object.
iter_start (
int) – The starting index for the iterator.iter_step (
int) – The step size for the iterator.
- append(name, data, **kwargs)
Appends a new dataset with the next consecutive numeric name.
- Parameters:
name – Ignored (kept for interface symmetry).
data – The dataset data to add.
kwargs – Additional keyword arguments passed to create_dataset.
- clear()
Removes all datasets used by the
DatasetList.
- class beautifuljason.base.DummyH5Group
Bases:
objectA dummy representation of an
H5Group.This class is used as a workaround for cases where the actual h5_group is None. It provides a mock interface to mimic the behavior of an
H5Groupwithout any actual data.
- class beautifuljason.base.Font(font_str: str | bytes)
Bases:
dictRepresents a font with various attributes. This class is designed to parse and represent fonts in a specific string format.
- Parameters:
font_str (
str|bytes) – The font string to parse. Accepts both str and bytes.- Raises:
TypeError – If the provided font_str is not of type str or bytes.
- class FontStyle(*values)
Bases:
IntEnumRepresents the style of the font, analogous to QFont::Style in Qt.
- Italic = 1
- Normal = 0
- Oblique = 2
- class FontStyleHint(*values)
Bases:
IntEnumRepresents the style hint of the font, analogous to QFont::StyleHint in Qt.
- AnyStyle = 5
- Courier = 2
- Cursive = 6
- Decorative = 3
- Fantasy = 8
- Helvetica = 0
- Monospace = 7
- OldEnglish = 3
- SansSerif = 0
- Serif = 1
- System = 4
- Times = 1
- TypeWriter = 2
- class FontWeight(*values)
Bases:
IntEnumRepresents the weight of the font using QFont::Weight values from Qt5. Qt6 values will be automatically converted to their Qt5 counterparts.
- Black = 87
- Bold = 75
- DemiBold = 63
- ExtraBold = 81
- ExtraLight = 12
- Light = 25
- Medium = 57
- Normal = 50
- Thin = 0
- classmethod _convert_from_qt6(value)
- classmethod _missing_(value)
- classmethod qt6_to_qt5_mapping()
- class beautifuljason.base.GroupList(h5_group, list_group_name: str, value_class)
Bases:
H5GroupRepresents a list-like structure within an HDF5 file.
- Parameters:
h5_group (h5py.Group) – The actual HDF5 group object.
list_group_name (
str) – The name of the group that contains the list.value_class (
type) – The class that represents the values within the list.
- class Iterator(h5_group, obj_class, iter_start: int, iter_step: int)
Bases:
H5GroupIterator for the GroupList class.
- Parameters:
h5_group (h5py.Group) – The actual HDF5 group object.
obj_class (
type) – The class that represents the values within the list.iter_start (
int) – The starting index for the iterator.iter_step (
int) – The step size for the iterator.
- append(attrs: Sequence[Mapping] | Mapping) None
Appends one or multiple items to the list.
- Parameters:
attrs (
Sequence|Mapping) – The item(s) to append to the list.- Raises:
TypeError – If the provided attrs is not of type Sequence or Mapping.
- class beautifuljason.base.H5Group(h5_group)
Bases:
objectRepresents a group within an HDF5 file.
- Parameters:
h5_group (h5py.Group) – The actual HDF5 group object.
- _attr(name, default=None)
Helper method to retrieve an attribute value with a default fallback.
- Parameters:
name (
str) – The name of the attribute to retrieve.default (Any) – The default value to return if the attribute is not found.
- Returns:
The value of the attribute or the default if not found.
- class beautifuljason.base.IDedObject(h5_group)
Bases:
H5GroupRepresents a group within an HDF5 file that has an ID.
- property id: str
Returns the ID of the object after validating its format.
- Returns:
The ID of the object.
- Return type:
str
- class beautifuljason.base.OriginalFileFormat(*values)
Bases:
IntEnumRepresents various file formats supported by JASON.
- CDXML = 28
- CSV = 24
- Castep = 9
- Custom = 17
- EMF = 15
- EMSA_MAS = 29
- Image = 12
- JCAMPDX = 18
- JEOL_Alice2 = 23
- JEOL_Delta = 10
- JEOL_Delta_Archive = 30
- JEOL_msTornado = 25
- JJD = 2
- JJH5 = 1
- JJJ = 3
- Magritek = 22
- Molfile = 11
- NMRPipe = 26
- NUTS = 31
- PDF = 14
- QONETEC = 32
- SIMPSON = 16
- SPINit = 21
- SVG = 13
- Spinevolution = 8
- Spinsight = 4
- TopSpin = 6
- TopSpinProc = 7
- Unknown = 0
- Vnmr = 5
- WinNMR = 19
- WinNMRProc = 20
- ZIP = 27
- class beautifuljason.base.PenStyle(*values)
Bases:
IntEnumRepresents various pen styles used in JASON. Corresponds to Qt’s Qt::PenStyle.
- CustomDashLine = 6
- DashDotDotLine = 5
- DashDotLine = 4
- DashLine = 2
- DotLine = 3
- NoPen = 0
- SolidLine = 1
- class beautifuljason.base.QMetaType_Type(*values)
Bases:
IntEnumRepresents data types analogous to Qt’s QMetaType::Type.
- Bool = 1
- Char = 34
- Char16 = 56
- Char32 = 57
- Double = 6
- Float = 38
- Int = 2
- Long = 32
- LongLong = 4
- QByteArray = 12
- QChar = 7
- QSize = 21
- QString = 10
- QStringList = 11
- QVariantList = 9
- SChar = 40
- Short = 33
- UChar = 37
- UInt = 3
- ULong = 35
- ULongLong = 5
- UShort = 36
- UnknownType = 0
- class beautifuljason.base.Units(*values)
Bases:
IntEnumRepresents various unit types used in JASON.
- CELSIUS = 29
- CM2perS = 13
- CM2perS_LIN = 16
- DEG = 9
- DPTS = 15
- DPTS_LIN = 18
- FAHRENHEIT = 31
- FPTS = 7
- FVIRT = 12
- GPTS = 22
- GperCM = 19
- HZ = 1
- KELVIN = 30
- KHZ = 2
- LPTS = 24
- LVAL = 23
- M2perS = 14
- M2perS_LIN = 17
- MHZ = 40
- MS = 5
- MZ = 28
- NONE = 0
- NS = 27
- PERCENTS = 10
- PPM = 3
- Pa = 25
- RrONEperS = 36
- RrPTS = 37
- RtMS = 33
- RtPTS = 35
- RtS = 34
- S = 6
- TEPTS = 32
- TPTS = 8
- TVIRT = 11
- TperM = 21
- US = 4
- V = 26
- eV = 38
- keV = 39
- mTperM = 20