Skip to content

Commit

Permalink
Black reformating
Browse files Browse the repository at this point in the history
  • Loading branch information
romainsacchi committed Sep 17, 2023
1 parent 39c1ce1 commit a35f6c7
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions unfold/unfold.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"""
import copy
import pickle
import uuid
from ast import literal_eval
from collections import defaultdict
from pathlib import Path
from typing import List, Union
import pickle

import bw2data
import bw2io
Expand Down Expand Up @@ -42,6 +42,7 @@

DIR_CACHED_DB = Path(__file__).parent / "cached_databases"


def _c(value):
"""Converts zero to one."""
if value == 0:
Expand Down Expand Up @@ -268,19 +269,13 @@ def clear_existing_cache(self):
or encountering issues with
inventories.
"""
[
f.unlink()
for f in Path(DIR_CACHED_DB).glob("*")
]
[f.unlink() for f in Path(DIR_CACHED_DB).glob("*")]

def check_cached_database(self, name) -> list:

# check that directory exists, otherwise create it
Path(DIR_CACHED_DB).mkdir(parents=True, exist_ok=True)

file_name = Path(
DIR_CACHED_DB / f"cached_{name}.pickle"
)
file_name = Path(DIR_CACHED_DB / f"cached_{name}.pickle")

# check that file path leads to an existing file
if file_name.exists():
Expand Down

0 comments on commit a35f6c7

Please sign in to comment.