Loading DMT/core/__init__.py +2 −2 Original line number Diff line number Diff line Loading @@ -87,8 +87,8 @@ from .plot_2yaxis import Plot2YAxis # Data management and processing from .data_processor import is_iterable, flatten, strictly_increasing, DataProcessor from .data_frame import DataFrame, df_concat from .sweep_def import SweepDef from .data_frame import DataFrame from .sweep_def import SweepDef, SweepDefConst, SweepDefLinear, SweepDefLog, SweepDefSync from .sweep import Sweep, get_sweepdef from .database_manager import DatabaseManager from .data_reader import ( Loading DMT/core/data_frame.py +25 −7 Original line number Diff line number Diff line Loading @@ -2450,6 +2450,12 @@ class DataFrame(DataProcessor, pd.DataFrame): else: Path(file_name).parent.mkdir(parents=True, exist_ok=True) for col in self.columns: if pd.api.types.is_complex_dtype(self[col]): self[col + sub_specifiers.REAL] = np.real(self[col]) self[col + sub_specifiers.IMAG] = np.imag(self[col]) del self[col] dict_convert = {} for col in self.columns: try: Loading @@ -2461,7 +2467,7 @@ class DataFrame(DataProcessor, pd.DataFrame): df_save.to_feather(file_name, version=version, compression=compression, **kwargs) @classmethod def from_feather(cls, file_name: Union[str, os.PathLike], to_specifier=True): def from_feather(cls, file_name: Union[str, os.PathLike], to_specifier=True) -> "DataFrame": """Load the data stored in file_name, where file_name is the direct path to the file. Parameters Loading Loading @@ -2496,10 +2502,22 @@ class DataFrame(DataProcessor, pd.DataFrame): if not df.columns.is_unique: raise IOError() return df for col in df.columns: if ( isinstance(col, SpecifierStr) and (sub_specifiers.REAL.sub_specifiers <= col.sub_specifiers) and (col - sub_specifiers.REAL + sub_specifiers.IMAG in df.columns) ): df[col - sub_specifiers.REAL] = ( df[col] + 1j * df[col - sub_specifiers.REAL + sub_specifiers.IMAG] ) del df[col] del df[col - sub_specifiers.REAL + sub_specifiers.IMAG] return df def df_concat(*frames): @classmethod def from_parts(cls, *frames: "DataFrame") -> "DataFrame": frame = pd.concat(frames, axis=0, ignore_index=True) frame.__class__ == DataFrame frame.__class__ == cls return frame DMT/core/data_processor.py +1 −3 Original line number Diff line number Diff line """ data processor module """ """data processor module""" # DMT_core # Copyright (C) from 2022 SemiMod Loading DMT/core/df_to_sweep.py +1 −2 Original line number Diff line number Diff line """ Converter routine to create a sweep definition from a given DataFrame """ """Converter routine to create a sweep definition from a given DataFrame""" # DMT_core # Copyright (C) from 2022 SemiMod Loading DMT/core/docu_dut_lib.py +1 −2 Original line number Diff line number Diff line """ Automatic documentation for DutLib """ """Automatic documentation for DutLib""" # Copyright (C) from 2022 SemiMod # <https://gitlab.com/dmt-development/dmt-core> Loading Loading
DMT/core/__init__.py +2 −2 Original line number Diff line number Diff line Loading @@ -87,8 +87,8 @@ from .plot_2yaxis import Plot2YAxis # Data management and processing from .data_processor import is_iterable, flatten, strictly_increasing, DataProcessor from .data_frame import DataFrame, df_concat from .sweep_def import SweepDef from .data_frame import DataFrame from .sweep_def import SweepDef, SweepDefConst, SweepDefLinear, SweepDefLog, SweepDefSync from .sweep import Sweep, get_sweepdef from .database_manager import DatabaseManager from .data_reader import ( Loading
DMT/core/data_frame.py +25 −7 Original line number Diff line number Diff line Loading @@ -2450,6 +2450,12 @@ class DataFrame(DataProcessor, pd.DataFrame): else: Path(file_name).parent.mkdir(parents=True, exist_ok=True) for col in self.columns: if pd.api.types.is_complex_dtype(self[col]): self[col + sub_specifiers.REAL] = np.real(self[col]) self[col + sub_specifiers.IMAG] = np.imag(self[col]) del self[col] dict_convert = {} for col in self.columns: try: Loading @@ -2461,7 +2467,7 @@ class DataFrame(DataProcessor, pd.DataFrame): df_save.to_feather(file_name, version=version, compression=compression, **kwargs) @classmethod def from_feather(cls, file_name: Union[str, os.PathLike], to_specifier=True): def from_feather(cls, file_name: Union[str, os.PathLike], to_specifier=True) -> "DataFrame": """Load the data stored in file_name, where file_name is the direct path to the file. Parameters Loading Loading @@ -2496,10 +2502,22 @@ class DataFrame(DataProcessor, pd.DataFrame): if not df.columns.is_unique: raise IOError() return df for col in df.columns: if ( isinstance(col, SpecifierStr) and (sub_specifiers.REAL.sub_specifiers <= col.sub_specifiers) and (col - sub_specifiers.REAL + sub_specifiers.IMAG in df.columns) ): df[col - sub_specifiers.REAL] = ( df[col] + 1j * df[col - sub_specifiers.REAL + sub_specifiers.IMAG] ) del df[col] del df[col - sub_specifiers.REAL + sub_specifiers.IMAG] return df def df_concat(*frames): @classmethod def from_parts(cls, *frames: "DataFrame") -> "DataFrame": frame = pd.concat(frames, axis=0, ignore_index=True) frame.__class__ == DataFrame frame.__class__ == cls return frame
DMT/core/data_processor.py +1 −3 Original line number Diff line number Diff line """ data processor module """ """data processor module""" # DMT_core # Copyright (C) from 2022 SemiMod Loading
DMT/core/df_to_sweep.py +1 −2 Original line number Diff line number Diff line """ Converter routine to create a sweep definition from a given DataFrame """ """Converter routine to create a sweep definition from a given DataFrame""" # DMT_core # Copyright (C) from 2022 SemiMod Loading
DMT/core/docu_dut_lib.py +1 −2 Original line number Diff line number Diff line """ Automatic documentation for DutLib """ """Automatic documentation for DutLib""" # Copyright (C) from 2022 SemiMod # <https://gitlab.com/dmt-development/dmt-core> Loading