From 1e97b7d1514c8bb10d11d9f300148a43931667f6 Mon Sep 17 00:00:00 2001 From: romainsacchi Date: Thu, 11 Apr 2024 09:21:40 +0000 Subject: [PATCH] Black reformating --- pathways/lca.py | 10 ++++++---- pathways/pathways.py | 13 +++++++------ 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/pathways/lca.py b/pathways/lca.py index c754f5f..f0c3694 100644 --- a/pathways/lca.py +++ b/pathways/lca.py @@ -3,7 +3,6 @@ """ - import csv import logging import uuid @@ -16,15 +15,18 @@ import pyprind from bw2calc import MonteCarloLCA from bw_processing import Datapackage -from numpy import ndarray, dtype +from numpy import dtype, ndarray from scipy import sparse from scipy.sparse import csr_matrix from .filesystem_constants import DIR_CACHED_DB from .lcia import fill_characterization_factors_matrices from .pathways import _group_technosphere_indices -from .utils import get_unit_conversion_factors, fetch_indices, check_unclassified_activities - +from .utils import ( + check_unclassified_activities, + fetch_indices, + get_unit_conversion_factors, +) logging.basicConfig( level=logging.DEBUG, diff --git a/pathways/pathways.py b/pathways/pathways.py index 7f28275..e0145be 100644 --- a/pathways/pathways.py +++ b/pathways/pathways.py @@ -21,7 +21,7 @@ from .data_validation import validate_datapackage from .filesystem_constants import DATA_DIR, DIR_CACHED_DB -from .lca import get_lca_matrices, _calculate_year +from .lca import _calculate_year, get_lca_matrices from .lcia import get_lcia_method_names from .utils import ( clean_cache_directory, @@ -32,7 +32,8 @@ load_classifications, load_numpy_array_from_disk, load_units_conversion, - resize_scenario_data, ) + resize_scenario_data, +) # remove warnings warnings.filterwarnings("ignore") @@ -110,9 +111,7 @@ class Pathways: def __init__(self, datapackage, debug=False): self.datapackage = datapackage - self.data, dataframe, self.filepaths = validate_datapackage( - _read_datapackage() - ) + self.data, dataframe, self.filepaths = validate_datapackage(_read_datapackage()) self.mapping = _get_mapping() self.mapping.update(self._get_final_energy_mapping()) self.debug = debug @@ -176,7 +175,9 @@ def create_dict_for_specific_model(row: dict, model: str) -> dict: return dict_structure return None - def create_dict_with_specific_model(dataframe: pandas.DataFrame, model: str) -> dict: + def create_dict_with_specific_model( + dataframe: pandas.DataFrame, model: str + ) -> dict: """ Create a dictionary for a specific model from the dataframe. :param dataframe: pandas.DataFrame