xpypact package¶
Subpackages¶
Submodules¶
xpypact.Fluxes module¶
xpypact.Inventory module¶
Helper class to load FISPACT inventory (output) from JSON file.
Implements list interface over time steps.
- xpypact.Inventory.__copy__(self, /)¶
copy a struct
- xpypact.Inventory.__delattr__(self, name, /)¶
Implement delattr(self, name).
- xpypact.Inventory.__dir__(self, /)¶
Default dir() implementation.
- xpypact.Inventory.__eq__(self, value, /)¶
Return self==value.
- xpypact.Inventory.__format__(self, format_spec, /)¶
Default object formatter.
Return str(self) if format_spec is empty. Raise TypeError otherwise.
- xpypact.Inventory.__ge__(self, value, /)¶
Return self>=value.
- xpypact.Inventory.__getattribute__(self, name, /)¶
Return getattr(self, name).
- xpypact.Inventory.__getstate__(self, /)¶
Helper for pickle.
- xpypact.Inventory.__gt__(self, value, /)¶
Return self>value.
- xpypact.Inventory.__hash__(self, /)¶
Return hash(self).
- xpypact.Inventory.__init_subclass__()¶
This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
- xpypact.Inventory.__le__(self, value, /)¶
Return self<=value.
- xpypact.Inventory.__lt__(self, value, /)¶
Return self<value.
- xpypact.Inventory.__ne__(self, value, /)¶
Return self!=value.
- xpypact.Inventory.__new__(*args, **kwargs)¶
Create and return a new object. See help(type) for accurate signature.
- xpypact.Inventory.__reduce__(self, /)¶
reduce a struct
- xpypact.Inventory.__reduce_ex__(self, protocol, /)¶
Helper for pickle.
- xpypact.Inventory.__replace__()¶
create a new struct with replacements
- xpypact.Inventory.__repr__(self, /)¶
Return repr(self).
- xpypact.Inventory.__rich_repr__(self, /)¶
rich repr
- xpypact.Inventory.__setattr__(self, name, value, /)¶
Implement setattr(self, name, value).
- xpypact.Inventory.__sizeof__(self, /)¶
Size of object in memory, in bytes.
- xpypact.Inventory.__str__(self, /)¶
Return str(self).
- xpypact.Inventory.__subclasshook__(object, /)¶
Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
xpypact.Nuclide module¶
Nuclide properties from FISPACT JSON.
- xpypact.Nuclide.__copy__(self, /)¶
copy a struct
- xpypact.Nuclide.__delattr__(self, name, /)¶
Implement delattr(self, name).
- xpypact.Nuclide.__dir__(self, /)¶
Default dir() implementation.
- xpypact.Nuclide.__eq__(self, value, /)¶
Return self==value.
- xpypact.Nuclide.__format__(self, format_spec, /)¶
Default object formatter.
Return str(self) if format_spec is empty. Raise TypeError otherwise.
- xpypact.Nuclide.__ge__(self, value, /)¶
Return self>=value.
- xpypact.Nuclide.__getattribute__(self, name, /)¶
Return getattr(self, name).
- xpypact.Nuclide.__getstate__(self, /)¶
Helper for pickle.
- xpypact.Nuclide.__gt__(self, value, /)¶
Return self>value.
- xpypact.Nuclide.__hash__(self, /)¶
Return hash(self).
- xpypact.Nuclide.__init_subclass__()¶
This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
- xpypact.Nuclide.__le__(self, value, /)¶
Return self<=value.
- xpypact.Nuclide.__lt__(self, value, /)¶
Return self<value.
- xpypact.Nuclide.__ne__(self, value, /)¶
Return self!=value.
- xpypact.Nuclide.__new__(*args, **kwargs)¶
Create and return a new object. See help(type) for accurate signature.
- xpypact.Nuclide.__reduce__(self, /)¶
reduce a struct
- xpypact.Nuclide.__reduce_ex__(self, protocol, /)¶
Helper for pickle.
- xpypact.Nuclide.__replace__()¶
create a new struct with replacements
- xpypact.Nuclide.__repr__(self, /)¶
Return repr(self).
- xpypact.Nuclide.__rich_repr__(self, /)¶
rich repr
- xpypact.Nuclide.__setattr__(self, name, value, /)¶
Implement setattr(self, name, value).
- xpypact.Nuclide.__sizeof__(self, /)¶
Size of object in memory, in bytes.
- xpypact.Nuclide.__str__(self, /)¶
Return str(self).
- xpypact.Nuclide.__subclasshook__(object, /)¶
Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
xpypact.RunData module¶
xpypact.TimeStep module¶
Time step attributes.
All names must be the same as in a FISPACT JSON file.
- xpypact.TimeStep.__copy__(self, /)¶
copy a struct
- xpypact.TimeStep.__delattr__(self, name, /)¶
Implement delattr(self, name).
- xpypact.TimeStep.__dir__(self, /)¶
Default dir() implementation.
- xpypact.TimeStep.__eq__(self, value, /)¶
Return self==value.
- xpypact.TimeStep.__format__(self, format_spec, /)¶
Default object formatter.
Return str(self) if format_spec is empty. Raise TypeError otherwise.
- xpypact.TimeStep.__ge__(self, value, /)¶
Return self>=value.
- xpypact.TimeStep.__getattribute__(self, name, /)¶
Return getattr(self, name).
- xpypact.TimeStep.__getstate__(self, /)¶
Helper for pickle.
- xpypact.TimeStep.__gt__(self, value, /)¶
Return self>value.
- xpypact.TimeStep.__hash__(self, /)¶
Return hash(self).
- xpypact.TimeStep.__init_subclass__()¶
This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
- xpypact.TimeStep.__le__(self, value, /)¶
Return self<=value.
- xpypact.TimeStep.__lt__(self, value, /)¶
Return self<value.
- xpypact.TimeStep.__ne__(self, value, /)¶
Return self!=value.
- xpypact.TimeStep.__new__(*args, **kwargs)¶
Create and return a new object. See help(type) for accurate signature.
- xpypact.TimeStep.__reduce__(self, /)¶
reduce a struct
- xpypact.TimeStep.__reduce_ex__(self, protocol, /)¶
Helper for pickle.
- xpypact.TimeStep.__replace__()¶
create a new struct with replacements
- xpypact.TimeStep.__repr__(self, /)¶
Return repr(self).
- xpypact.TimeStep.__rich_repr__(self, /)¶
rich repr
- xpypact.TimeStep.__setattr__(self, name, value, /)¶
Implement setattr(self, name, value).
- xpypact.TimeStep.__sizeof__(self, /)¶
Size of object in memory, in bytes.
- xpypact.TimeStep.__str__(self, /)¶
Return str(self).
- xpypact.TimeStep.__subclasshook__(object, /)¶
Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
xpypact.data_arrays module¶
Module contents¶
The xpypact package.
Wraps FISPACT workflow. Transforms FISPACT output to Polars and duckdb datasets.
- class xpypact.DoseRate[source]¶
Bases:
StructDose rate attributes.
Don’t scale by mass, for point source mass is always 1g, for contact dose mass is meaningless.
- Attrs:
type: “Plain source” for contact dose or “Point source” distance: specified for “point source”, meters mass: mass for point source, always 1g
- class xpypact.FullDataCollector[source]¶
Bases:
StructClass to collect inventory over multiple inventories method.
Note
we assume that all the gamma boundaries are the same over all JSON files to be appended.
- class Result[source]¶
Bases:
StructFinished collected data.
The only function of this class is to save the collected data to parquet files.
-
nuclide:
DataFrame¶
-
rundata:
DataFrame¶
-
time_step_times:
DataFrame¶
-
timestep:
DataFrame¶
-
timestep_nuclide:
DataFrame¶
-
nuclide:
- append(inventory, material_id, case_id)[source]¶
Append inventory to this collector.
- Parameters:
- Return type:
- Returns:
self - for chaining
- get_gbins()[source]¶
Retrieve gbins.
- Returns:
g [0..N], boundary[g]
- Return type:
Polars table with gbins
- get_nuclides_as_df()[source]¶
Retrieve collected nuclides.
- Return type:
DataFrame- Returns:
table of collected nuclides
- get_timestep_gamma_as_spectrum()[source]¶
Convert gamma values MeV/s -> photon/s.
In FISPACT JSON gamma emission is presented in MeV/s, but we need intensities in photon/s to represent gamma source.
- Return type:
DataFrame|None- Returns:
time_step_gamma with rates in photon/s
- lock = <unlocked _thread.RLock object owner=0 count=0>¶
-
nuclides:
set[NuclideInfo]¶
-
rundata:
DataFrame¶
-
timestep_gamma:
DataFrame¶
-
timestep_nuclides:
DataFrame¶
-
timesteps:
DataFrame¶
- class xpypact.GammaSpectrum[source]¶
Bases:
StructData on gamma emission.
- Attrs:
- boundaries:
Energy boundaries, MeV
- intensities:
Gamma emission intensity.
- class xpypact.Inventory[source]¶
Bases:
StructHelper class to load FISPACT inventory (output) from JSON file.
Implements list interface over time steps.
- __len__()[source]¶
Length, delegated to time steps.
- Returns:
length of the time steps list.
- Return type:
- __post_init__()[source]¶
Define time steps durations and elapsed time.
- Raises:
InventoryNonMonotonicTimesError – if time sequences in JSON are not in order
- Return type:
- extract_nuclides()[source]¶
Extract.
- Return type:
- Returns:
Set of nuclides present in this inventory.
- extract_times()[source]¶
Create vector of elapsed time for all the time steps in the inventory.
- Return type:
NDArrayFloat
- Returns:
Vector with elapsed times.
- property meta_info: RunDataCorrected¶
Create corrected Inventory header.
- Returns:
with common data for the inventory.
- Return type:
-
run_data:
RunData¶
- class xpypact.Nuclide[source]¶
Bases:
StructNuclide properties from FISPACT JSON.
- Parameters:
- property info: NuclideInfo¶
Extract a nuclide specific information.
- Returns:
element, a, state, zai, half_life
- class xpypact.NuclideInfo[source]¶
Bases:
_NuclideIDBasic information on a nuclide.
This is extracted as a separate database entity to improve normalization.
- class xpypact.RunDataCorrected[source]¶
Bases:
StructCommon data for an FISPACT inventory.
Note
Correction - dose_rate_type and dose_rate_distance are duplicated the FISPACT time steps. This information is extracted to this header.
- class xpypact.TimeStep[source]¶
Bases:
StructTime step attributes.
All names must be the same as in a FISPACT JSON file.
- Parameters:
number (int)
irradiation_time (float)
cooling_time (float)
duration (float)
elapsed_time (float)
flux (float)
total_atoms (float)
total_activity (float)
alpha_activity (float)
beta_activity (float)
gamma_activity (float)
total_mass (float)
total_heat (float)
alpha_heat (float)
beta_heat (float)
gamma_heat (float)
ingestion_dose (float)
inhalation_dose (float)
dose_rate (DoseRate)
gamma_spectrum (GammaSpectrum | None)
-
gamma_spectrum:
GammaSpectrum|None¶