Skip to content

Commit

Permalink
Merge pull request #759 from janosh/flake8+isort
Browse files Browse the repository at this point in the history
Flake8+isort
  • Loading branch information
ardunn authored Jan 13, 2022
2 parents dd008f2 + e3652ff commit db19424
Show file tree
Hide file tree
Showing 78 changed files with 290 additions and 290 deletions.
10 changes: 4 additions & 6 deletions matminer/data_retrieval/retrieve_AFLOW.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
from functools import reduce

from pandas import DataFrame

from pymatgen.core.structure import Structure

from matminer.data_retrieval.retrieve_base import BaseDataRetrieval

from aflow import K # module of aflow Keyword properties
from aflow.caster import cast
from aflow.control import Query
from aflow.entries import AflowFile
from pandas import DataFrame
from pymatgen.core.structure import Structure

from matminer.data_retrieval.retrieve_base import BaseDataRetrieval

__author__ = ["Maxwell Dylla <[email protected]>"]

Expand Down
26 changes: 14 additions & 12 deletions matminer/data_retrieval/retrieve_Citrine.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
import os
import time
from collections import Counter

import numpy as np
import pandas as pd
from citrination_client import (
CitrinationClient,
ChemicalFieldQuery,
ChemicalFilter,
CitrinationClient,
DataQuery,
DatasetQuery,
FieldQuery,
PropertyQuery,
Filter,
ReferenceQuery,
PifSystemQuery,
DatasetQuery,
DataQuery,
PifSystemReturningQuery,
PropertyQuery,
ReferenceQuery,
)
import os
import time
import pandas as pd
from matminer.data_retrieval.retrieve_base import BaseDataRetrieval
from tqdm import tqdm
from pandas.io.json import json_normalize
import numpy as np
from collections import Counter
from tqdm import tqdm

from matminer.data_retrieval.retrieve_base import BaseDataRetrieval

__author__ = [
"Saurabh Bajaj <[email protected]>",
Expand Down
4 changes: 2 additions & 2 deletions matminer/data_retrieval/retrieve_MDF.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pandas as pd
from matminer.data_retrieval.retrieve_base import BaseDataRetrieval

from mdf_forge.forge import Forge

from matminer.data_retrieval.retrieve_base import BaseDataRetrieval
from matminer.utils.flatten_dict import flatten_dict

__author__ = "Joseph Montoya <[email protected]>"
Expand Down
5 changes: 2 additions & 3 deletions matminer/data_retrieval/retrieve_MP.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import pandas as pd
from matminer.data_retrieval.retrieve_base import BaseDataRetrieval
from pymatgen.ext.matproj import MPRester, MPRestError

from pymatgen.ext.matproj import MPRester
from pymatgen.ext.matproj import MPRestError
from matminer.data_retrieval.retrieve_base import BaseDataRetrieval

__author__ = [
"Saurabh Bajaj <[email protected]>",
Expand Down
3 changes: 2 additions & 1 deletion matminer/data_retrieval/retrieve_MPDS.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
import warnings

import httplib2
from matminer.data_retrieval.retrieve_base import BaseDataRetrieval
from six.moves.urllib_parse import urlencode

from matminer.data_retrieval.retrieve_base import BaseDataRetrieval

try:
import ujson as json
except ImportError:
Expand Down
8 changes: 5 additions & 3 deletions matminer/data_retrieval/retrieve_MongoDB.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import pandas as pd
from functools import reduce
from itertools import groupby
from matminer.data_retrieval.retrieve_base import BaseDataRetrieval

import pandas as pd
from tqdm import tqdm
from functools import reduce

from matminer.data_retrieval.retrieve_base import BaseDataRetrieval

__author__ = "Anubhav Jain <[email protected]>"

Expand Down
2 changes: 1 addition & 1 deletion matminer/data_retrieval/tests/test_retrieve_AFLOW.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import unittest
import numpy as np

import numpy as np
from pymatgen.core.structure import Structure

from matminer.data_retrieval.retrieve_AFLOW import AFLOWDataRetrieval
Expand Down
2 changes: 1 addition & 1 deletion matminer/data_retrieval/tests/test_retrieve_MDF.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import unittest
import os
import unittest

from matminer.data_retrieval.retrieve_MDF import MDFDataRetrieval, make_dataframe

Expand Down
5 changes: 3 additions & 2 deletions matminer/data_retrieval/tests/test_retrieve_MP.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import unittest

from matminer.data_retrieval.retrieve_MP import MPDataRetrieval
from pymatgen.core import SETTINGS
from pymatgen.electronic_structure.bandstructure import (
BandStructureSymmLine,
BandStructure,
BandStructureSymmLine,
)
from pymatgen.electronic_structure.dos import CompleteDos

from matminer.data_retrieval.retrieve_MP import MPDataRetrieval


@unittest.skipIf(not SETTINGS.get("PMG_MAPI_KEY", ""), "PMG_MAPI_KEY not in environment variables.")
class MPDataRetrievalTest(unittest.TestCase):
Expand Down
4 changes: 3 additions & 1 deletion matminer/data_retrieval/tests/test_retrieve_MPDS.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
import ujson as json
except ImportError:
import json

import unittest
from jsonschema import validate, Draft4Validator

from jsonschema import Draft4Validator, validate
from jsonschema.exceptions import ValidationError

from matminer.data_retrieval.retrieve_MPDS import MPDSDataRetrieval
Expand Down
8 changes: 6 additions & 2 deletions matminer/data_retrieval/tests/test_retrieve_MongoDB.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import unittest

from pymongo import MongoClient
from pymatgen.util.testing import PymatgenTest
from pymongo import MongoClient

from matminer.data_retrieval.retrieve_MongoDB import clean_projection, remove_ints, MongoDataRetrieval
from matminer.data_retrieval.retrieve_MongoDB import (
MongoDataRetrieval,
clean_projection,
remove_ints,
)
from matminer.data_retrieval.tests.base import on_ci


Expand Down
10 changes: 5 additions & 5 deletions matminer/datasets/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from .dataset_retrieval import (
load_dataset,
get_all_dataset_info,
get_available_datasets,
get_dataset_attribute,
get_dataset_citations,
get_dataset_column_description,
get_dataset_reference,
get_dataset_columns,
get_dataset_num_entries,
get_dataset_description,
get_dataset_attribute,
get_all_dataset_info,
get_dataset_num_entries,
get_dataset_reference,
load_dataset,
)
2 changes: 1 addition & 1 deletion matminer/datasets/dataset_retrieval.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import os

from matminer.datasets.utils import (
_load_dataset_dict,
_get_data_home,
_load_dataset_dict,
_validate_dataset,
)
from matminer.utils.io import load_dataframe_from_json
Expand Down
2 changes: 1 addition & 1 deletion matminer/datasets/tests/base.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import unittest
import os
import unittest

from matminer.datasets.utils import _load_dataset_dict

Expand Down
31 changes: 16 additions & 15 deletions matminer/datasets/tests/test_convenience_loaders.py
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
import pandas as pd
import unittest

from matminer.datasets.tests.base import DatasetTest, do_complete_test
import pandas as pd

from matminer.datasets.convenience_loaders import (
load_glass_ternary_hipt,
load_castelli_perovskites,
load_flla,
load_boltztrap_mp,
load_brgoch_superhard_training,
load_castelli_perovskites,
load_citrine_thermal_conductivity,
load_dielectric_constant,
load_double_perovskites_gap,
load_double_perovskites_gap_lumo,
load_elastic_tensor,
load_expt_formation_enthalpy,
load_expt_gap,
load_flla,
load_glass_binary,
load_glass_ternary_hipt,
load_glass_ternary_landolt,
load_phonon_dielectric_mp,
load_piezoelectric_tensor,
load_mp,
load_wolverton_oxides,
load_heusler_magnetic,
load_steel_strength,
load_jarvis_ml_dft_training,
load_jarvis_dft_2d,
load_jarvis_dft_3d,
load_expt_formation_enthalpy,
load_expt_gap,
load_glass_binary,
load_jarvis_ml_dft_training,
load_m2ax,
load_brgoch_superhard_training,
load_mp,
load_phonon_dielectric_mp,
load_piezoelectric_tensor,
load_steel_strength,
load_wolverton_oxides,
)
from matminer.datasets.tests.base import DatasetTest, do_complete_test

if do_complete_test:

Expand Down
12 changes: 6 additions & 6 deletions matminer/datasets/tests/test_dataset_retrieval.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import unittest

from matminer.datasets.tests.base import DatasetTest
from matminer.datasets.dataset_retrieval import (
load_dataset,
get_all_dataset_info,
get_available_datasets,
get_dataset_attribute,
get_dataset_citations,
get_dataset_column_description,
get_dataset_columns,
get_dataset_description,
get_dataset_num_entries,
get_dataset_columns,
get_dataset_reference,
get_dataset_column_description,
get_dataset_citations,
get_all_dataset_info,
load_dataset,
)
from matminer.datasets.tests.base import DatasetTest


class DataRetrievalTest(DatasetTest):
Expand Down
10 changes: 5 additions & 5 deletions matminer/datasets/tests/test_datasets.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import unittest
import os
import unittest

import requests
import numpy as np
from pandas.api.types import is_numeric_dtype, is_object_dtype, is_bool_dtype
from pymatgen.core.structure import Structure, Composition
import requests
from pandas.api.types import is_bool_dtype, is_numeric_dtype, is_object_dtype
from pymatgen.core.structure import Composition, Structure

from matminer.datasets.tests.base import DatasetTest, do_complete_test
from matminer.datasets.dataset_retrieval import load_dataset
from matminer.datasets.tests.base import DatasetTest, do_complete_test


class DataSetsTest(DatasetTest):
Expand Down
9 changes: 5 additions & 4 deletions matminer/datasets/tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import unittest
import os
import unittest

import pandas as pd

from matminer.datasets.tests.base import DatasetTest
from matminer.datasets.utils import (
_load_dataset_dict,
_get_file_sha256_hash,
_fetch_external_dataset,
_validate_dataset,
_get_data_home,
_get_file_sha256_hash,
_load_dataset_dict,
_read_dataframe_from_file,
_validate_dataset,
)


Expand Down
6 changes: 3 additions & 3 deletions matminer/datasets/utils.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import os
import hashlib
import json
import requests
import os

import tqdm
import pandas as pd
import requests
import tqdm

__author__ = "Daniel Dopp <[email protected]>"

Expand Down
10 changes: 5 additions & 5 deletions matminer/featurizers/bandstructure.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import sys
import warnings
from collections import OrderedDict

import numpy as np
from collections import OrderedDict
from numpy.linalg import norm
from scipy.interpolate import griddata

from matminer.featurizers.base import BaseFeaturizer
from pymatgen.electronic_structure.core import Spin
from pymatgen.electronic_structure.bandstructure import (
BandStructure,
BandStructureSymmLine,
)
from pymatgen.electronic_structure.core import Spin
from pymatgen.symmetry.analyzer import SpacegroupAnalyzer
from scipy.interpolate import griddata

from matminer.featurizers.base import BaseFeaturizer

__author__ = "Anubhav Jain <[email protected]>"

Expand Down
23 changes: 11 additions & 12 deletions matminer/featurizers/composition/__init__.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
from matminer.featurizers.composition.element import ElementFraction, TMetalFraction, Stoichiometry, BandCenter

from matminer.featurizers.composition.composite import Meredig, ElementProperty

from matminer.featurizers.composition.alloy import YangSolidSolution, Miedema, WenAlloys

from matminer.featurizers.composition.alloy import Miedema, WenAlloys, YangSolidSolution
from matminer.featurizers.composition.composite import ElementProperty, Meredig
from matminer.featurizers.composition.element import (
BandCenter,
ElementFraction,
Stoichiometry,
TMetalFraction,
)
from matminer.featurizers.composition.ion import (
IonProperty,
CationProperty,
OxidationStates,
ElectronAffinity,
ElectronegativityDiff,
IonProperty,
OxidationStates,
)

from matminer.featurizers.composition.orbital import AtomicOrbitals, ValenceOrbital


from matminer.featurizers.composition.packing import AtomicPackingEfficiency
from matminer.featurizers.composition.thermo import CohesiveEnergyMP, CohesiveEnergy
from matminer.featurizers.composition.thermo import CohesiveEnergy, CohesiveEnergyMP
Loading

0 comments on commit db19424

Please sign in to comment.