Commit 24b05b90 authored by Mario's avatar Mario
Browse files

switching to lower level imports to avoid circular imports and allow "forward...

switching to lower level imports to avoid circular imports and allow "forward references" as type annotations
parent 9779f1a5
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ import logging
import copy
from scipy.optimize import curve_fit
from DMT.exceptions import UnknownColumnError
from DMT.core.data_processor import DataProcessor, flatten
from DMT.core import (
    specifiers_ss_para,
    get_specifier_from_string,
@@ -37,8 +38,6 @@ from DMT.core import (
    sub_specifiers,
    get_nodes,
    get_sub_specifiers,
    flatten,
    DataProcessor,
)
import pandas as pd

+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@
# along with this program.  If not, see <http://www.gnu.org/licenses/>
import numpy as np
from skrf import network as rf_network
from DMT.core import specifiers, sub_specifiers
from DMT.core.naming import specifiers, sub_specifiers


def is_iterable(arg):
+1 −1
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@ import re
import _pickle as pickle
import struct
from pathlib import Path
from DMT.core import DataFrame
from DMT.core.data_frame import DataFrame


def read_data(filename, key=None, **kwargs):
+10 −13
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>
from __future__ import annotations
import os
import re
import shutil
@@ -33,16 +34,12 @@ try:
except ImportError:
    from semver import VersionInfo

from DMT.core import (
    DatabaseManager,
    read_data,
    DataFrame,
    VAFileMap,
    DutTypeFlag,
    DutTypeInt,
    DutType,
    Technology,
)
from DMT.core.data_frame import DataFrame
from DMT.core.database_manager import DatabaseManager
from DMT.core.data_reader import read_data
from DMT.core.dut_type import DutTypeFlag, DutTypeInt, DutType
from DMT.core.va_file import VAFileMap
import DMT.core.technology as dmt_tech
from DMT.config import DATA_CONFIG
from DMT.exceptions import UnknownColumnError

@@ -170,7 +167,7 @@ class DutView(object):
        simulate_on_server=None,
        simulator_command="",
        simulator_arguments=None,
        technology=None,
        technology: "dmt_tech.Technology" = None,
        width=None,
        length=None,
        nfinger=None,
@@ -585,7 +582,7 @@ class DutView(object):
    @staticmethod
    def load_dut(
        file_dut,
        classes_technology: List[Type[Technology]] = None,
        classes_technology: List[Type["dmt_tech.Technology"]] = None,
        classes_dut_view: List[Type["DutView"]] = None,
    ) -> "DutView":
        """Static class method. Loads a DutView object from a pickle file with full path save_dir.
@@ -654,7 +651,7 @@ class DutView(object):
    def from_json(
        cls,
        json_content: Dict,
        classes_technology: List[Type[Technology]],
        classes_technology: List[Type["dmt_tech.Technology"]],
        subclass_kwargs: Dict = None,
    ) -> "DutView":
        """Static class method. Loads a DutView object from a pickle file with full path save_dir.
+12 −2
Original line number Diff line number Diff line
@@ -24,6 +24,8 @@ If a technology can use TRADICA, the class :class:`DMT.TRADICA.TechTradica` is r
# along with this program.  If not, see <http://www.gnu.org/licenses/>
import abc
from DMT.core.dut_type import DutType
import DMT.core.mcard as dmt_mcard
import DMT.core.dut_view as dmt_dv

try:
    from pylatex import Section
@@ -187,8 +189,16 @@ class Technology(object):
        raise NotImplementedError

    def scale_modelcard(
        self, mcard, lE0, bE0, nfinger, config, dut=None, lE_drawn_ref=None, bE_drawn_ref=None
    ):
        self,
        mcard: "dmt_mcard.MCard",
        lE0: float,
        bE0: float,
        nfinger: int,
        config: str,
        dut: "dmt_dv.DutView" = None,
        lE_drawn_ref: float = None,
        bE_drawn_ref: float = None,
    ) -> "dmt_mcard.MCard":
        """This method scales a already finished modelcard (no sheet resistances).

        Parameters