Commit 330b849a authored by Mario Krattenmacher's avatar Mario Krattenmacher
Browse files

Merge branch '26-direct-mdm-to-ngspice-simulation-connection' into 'main'

Resolve "direct mdm to ngspice simulation connection"

Closes #26

See merge request !16
parents c14d3ca5 4dca382b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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 (
+25 −7
Original line number Diff line number Diff line
@@ -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:
@@ -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
@@ -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
+1 −3
Original line number Diff line number Diff line
""" data processor module

"""
"""data processor module"""

# DMT_core
# Copyright (C) from 2022  SemiMod
+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
+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