module myna.database.pelican
Database class for extracting data from MDF Pelican build data
class Pelican
Database of Pelican data for a directed energy deposition build
method Pelican.__init__
__init__()
method Pelican.clean_build_data
clean_build_data(df)
Cleans pelican data to ensure that there are no null rows left in the DataFrame
Args:
df: (polars.DataFrame) DataFrame containing "x (mm)", "y (mm)", "z (mm)", "time (s)" and "time" columns
method Pelican.convert_dataframe_to_myna_scanpath
convert_dataframe_to_myna_scanpath(df, power=1)
Converts a polars.DataFrame in the initialize_dataframe() schema to a Myna scan path.
Args:
df: (polars.DataFrame)power: (float) Power, in Watts
method Pelican.exists
exists()
method Pelican.get_scan_path
get_scan_path(part, layer)
Extracts the scan path file for the database if needed, then returns the scanpath file path
Args:
part: (str) part name to extract data forlayer: (int) "layer" corresponding to the time_segment for the part in the Myna input file
method Pelican.get_segment_details
get_segment_details(part, layer)
Gets the start and end time and starting details for the given "layer" in the part. This is a translation layer between the time-segment nature of the Pelican database and the layer structure of the myna.core.workflow.config functionality.
Args:
part: (str) part name to extract data forlayer: (str) "layer" corresponding to the time_segment for the part in the Myna input file
method Pelican.initialize_dataframe
initialize_dataframe(
segment_dict=None,
epoch=datetime.datetime(1970, 1, 1, 0, 0)
)
Loads the raw x, y, z, and time data from the Pelican simulation data directory.
Args:
path: (str) path to the Pelican directorysegment_dict: (None, {x,y,z,onoff,time}) dictionary describing segment start/end conditionsdatatype: (str) ["raw", "resampled"] type of data to load from Pelicanepoch: (datetime.datetime instance) datetime object to use as the epoch
Returns: polars.DataFrame instance with the columns: - "x (mm)": float, X-coordinate in meters at given time - "y (mm)": float, Y-coordinate in meters at given time - "z (mm)": float, Z-coordinate in meters at given time - "time (s)": float, time in seconds corresponding to the XYZ location - "time": pl.Datetime, time since epoch
method Pelican.load
load(metadata_type, part=None, layer=None)
Load and return a metadata value from the database
Note that layer is never used, because Pelican does not have the layer concept
method Pelican.load_build_data
load_build_data(
datatype='raw',
segment_dict=None,
epoch=datetime.datetime(1970, 1, 1, 0, 0)
)
Loads the raw x, y, z, and time data from the Pelican simulation data directory.
Args:
datatype: (str) ["raw", "resampled"] type of data to load from Pelicanepoch: (datetime.datetime instance) datetime object to use as the epoch
Returns:
polars.DataFrame instance with the columns defined by initialize_dataframe()
method Pelican.set_path
set_path(path)
Set the path to the database
Args:
path: filepath to the directory containing Pelican build data
method Pelican.sync
sync(component_type, step_types, output_class, files)
Sync result files to the database using Pelican-style directory and file structure.
Args:
component_type: (str) name of workflow component app, i.e., Component.component_applicationstep_types: (list of str) list of workflow component types, i.e., Component.typesoutput_class: class object for the output file, e.g., Component.output_requirementfiles: List of files to sync for the passed workflow component
Returns:
synced_files: list of files that were synced
For each time segment (i.e., "layer"): 1. Open the corresponding data file (CSV?, Arrow?, Parquet?, HDF5?) 2. Get all compatible time-series data from the completed Myna Components 3. Write all time-series data to the file with each row being a unique time and each column corresponding to the variable name (consider overwrite behavior) 4. Close the file stream
This file was automatically generated via lazydocs.