From 2aebcff3d44f1037facd85b2f77c467c30ef3abf Mon Sep 17 00:00:00 2001 From: Filippo Martini Date: Thu, 17 Dec 2020 16:21:53 +0100 Subject: [PATCH] Optimize imports --- PyCTBN/classes/__init__.py | 10 +++++----- PyCTBN/classes/abstract_importer.py | 3 ++- PyCTBN/classes/json_importer.py | 1 + PyCTBN/classes/network_graph.py | 1 + PyCTBN/classes/parameters_estimator.py | 4 ++-- PyCTBN/classes/set_of_cims.py | 1 + PyCTBN/classes/structure.py | 1 + PyCTBN/classes/structure_estimator.py | 3 ++- PyCTBN/classes/trajectory.py | 3 ++- 9 files changed, 17 insertions(+), 10 deletions(-) diff --git a/PyCTBN/classes/__init__.py b/PyCTBN/classes/__init__.py index b987b5b..d6fad7a 100644 --- a/PyCTBN/classes/__init__.py +++ b/PyCTBN/classes/__init__.py @@ -1,11 +1,11 @@ -from .json_importer import JsonImporter from .abstract_importer import AbstractImporter +from .cache import Cache +from .conditional_intensity_matrix import ConditionalIntensityMatrix +from .json_importer import JsonImporter from .network_graph import NetworkGraph -from .sample_path import SamplePath from .parameters_estimator import ParametersEstimator +from .sample_path import SamplePath +from .set_of_cims import SetOfCims from .structure import Structure from .structure_estimator import StructureEstimator from .trajectory import Trajectory -from .conditional_intensity_matrix import ConditionalIntensityMatrix -from .cache import Cache -from .set_of_cims import SetOfCims \ No newline at end of file diff --git a/PyCTBN/classes/abstract_importer.py b/PyCTBN/classes/abstract_importer.py index 8222e45..513a6e7 100644 --- a/PyCTBN/classes/abstract_importer.py +++ b/PyCTBN/classes/abstract_importer.py @@ -1,7 +1,8 @@ +import typing from abc import ABC, abstractmethod + import pandas as pd -import typing class AbstractImporter(ABC): diff --git a/PyCTBN/classes/json_importer.py b/PyCTBN/classes/json_importer.py index 23f2420..201104f 100644 --- a/PyCTBN/classes/json_importer.py +++ b/PyCTBN/classes/json_importer.py @@ -1,6 +1,7 @@ import json import typing + import pandas as pd from .abstract_importer import AbstractImporter diff --git a/PyCTBN/classes/network_graph.py b/PyCTBN/classes/network_graph.py index a18658f..455c13e 100644 --- a/PyCTBN/classes/network_graph.py +++ b/PyCTBN/classes/network_graph.py @@ -1,5 +1,6 @@ import typing + import networkx as nx import numpy as np diff --git a/PyCTBN/classes/parameters_estimator.py b/PyCTBN/classes/parameters_estimator.py index 01254e2..3542643 100644 --- a/PyCTBN/classes/parameters_estimator.py +++ b/PyCTBN/classes/parameters_estimator.py @@ -1,9 +1,9 @@ import numpy as np -from .trajectory import Trajectory -from .set_of_cims import SetOfCims from .network_graph import NetworkGraph +from .set_of_cims import SetOfCims +from .trajectory import Trajectory class ParametersEstimator(object): diff --git a/PyCTBN/classes/set_of_cims.py b/PyCTBN/classes/set_of_cims.py index 7bb89f9..d672cc3 100644 --- a/PyCTBN/classes/set_of_cims.py +++ b/PyCTBN/classes/set_of_cims.py @@ -1,4 +1,5 @@ import typing + import numpy as np from .conditional_intensity_matrix import ConditionalIntensityMatrix diff --git a/PyCTBN/classes/structure.py b/PyCTBN/classes/structure.py index 7e39277..1594e19 100644 --- a/PyCTBN/classes/structure.py +++ b/PyCTBN/classes/structure.py @@ -1,4 +1,5 @@ import typing as ty + import numpy as np diff --git a/PyCTBN/classes/structure_estimator.py b/PyCTBN/classes/structure_estimator.py index 5203f08..e6812b5 100644 --- a/PyCTBN/classes/structure_estimator.py +++ b/PyCTBN/classes/structure_estimator.py @@ -1,13 +1,14 @@ -from tqdm import tqdm import itertools import json import typing + import networkx as nx import numpy as np from networkx.readwrite import json_graph from scipy.stats import chi2 as chi2_dist from scipy.stats import f as f_dist +from tqdm import tqdm from .cache import Cache from .conditional_intensity_matrix import ConditionalIntensityMatrix diff --git a/PyCTBN/classes/trajectory.py b/PyCTBN/classes/trajectory.py index 1254016..6cb41f4 100644 --- a/PyCTBN/classes/trajectory.py +++ b/PyCTBN/classes/trajectory.py @@ -1,7 +1,8 @@ -import numpy as np import typing +import numpy as np + class Trajectory(object): """ Abstracts the infos about a complete set of trajectories, represented as a numpy array of doubles