Skip to content

Commit 74b9c91

Browse files
committed
pre-commit format
1 parent 780328f commit 74b9c91

File tree

5 files changed

+18
-16
lines changed

5 files changed

+18
-16
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Before running any training scripts, ensure the environment is correctly configu
6464
export PYTHONPATH=path/to/python-chebai
6565
```
6666
or vice versa.
67-
67+
6868
* If you're working within both repositories simultaneously or facing module not found errors, we **recommend configuring both directories**:
6969
7070
```bash

chebai_proteins/preprocessing/datasets/deepGO/go_uniprot.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def _download_gene_ontology_data(self) -> str:
181181

182182
if not os.path.isfile(go_path):
183183
print("Missing Gene Ontology raw data")
184-
print(f"Downloading Gene Ontology data....")
184+
print("Downloading Gene Ontology data....")
185185
r = requests.get(self._GO_DATA_URL, allow_redirects=True)
186186
r.raise_for_status() # Check if the request was successful
187187
open(go_path, "wb").write(r.content)
@@ -207,7 +207,7 @@ def _download_swiss_uni_prot_data(self) -> Optional[str]:
207207
os.makedirs(os.path.dirname(uni_prot_file_path), exist_ok=True)
208208

209209
if not os.path.isfile(uni_prot_file_path):
210-
print(f"Downloading Swiss UniProt data....")
210+
print("Downloading Swiss UniProt data....")
211211

212212
# Create a temporary file
213213
with NamedTemporaryFile(delete=False) as tf:
@@ -223,7 +223,7 @@ def _download_swiss_uni_prot_data(self) -> Optional[str]:
223223

224224
# Unpack the gzipped file
225225
try:
226-
print(f"Unzipping the file....")
226+
print("Unzipping the file....")
227227
with gzip.open(temp_filename, "rb") as f_in:
228228
output_file_path = uni_prot_file_path
229229
with open(output_file_path, "wb") as f_out:
@@ -375,7 +375,7 @@ def _graph_to_raw_dataset(self, g: nx.DiGraph) -> pd.DataFrame:
375375
Returns:
376376
pd.DataFrame: The raw dataset created from the graph.
377377
"""
378-
print(f"Processing graph")
378+
print("Processing graph")
379379

380380
data_df = self._get_swiss_to_go_mapping()
381381
# add ancestors to go ids
@@ -559,8 +559,8 @@ def _get_data_splits(self) -> Tuple[pd.DataFrame, pd.DataFrame, pd.DataFrame]:
559559
)
560560
except FileNotFoundError:
561561
raise FileNotFoundError(
562-
f"File data.pt doesn't exists. "
563-
f"Please call 'prepare_data' and/or 'setup' methods to generate the dataset files"
562+
"File data.pt doesn't exists. "
563+
"Please call 'prepare_data' and/or 'setup' methods to generate the dataset files"
564564
)
565565

566566
df_go_data = pd.DataFrame(data_go)
@@ -586,7 +586,7 @@ def base_dir(self) -> str:
586586
Returns:
587587
str: The path to the base directory, which is "data/GO_UniProt".
588588
"""
589-
return os.path.join("data", f"GO_UniProt")
589+
return os.path.join("data", "GO_UniProt")
590590

591591
@property
592592
def raw_file_names_dict(self) -> dict:

chebai_proteins/preprocessing/datasets/deepGO/protein_pretraining.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,8 @@ def _get_data_splits(self) -> Tuple[pd.DataFrame, pd.DataFrame, pd.DataFrame]:
223223
)
224224
except FileNotFoundError:
225225
raise FileNotFoundError(
226-
f"File data.pt doesn't exists. "
227-
f"Please call 'prepare_data' and/or 'setup' methods to generate the dataset files"
226+
"File data.pt doesn't exists. "
227+
"Please call 'prepare_data' and/or 'setup' methods to generate the dataset files"
228228
)
229229

230230
df_go_data = pd.DataFrame(data_go)

chebai_proteins/preprocessing/datasets/scope/scope.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def _download_pdb_sequence_data(self) -> None:
130130
os.makedirs(os.path.dirname(pdb_seq_file_path), exist_ok=True)
131131

132132
if not os.path.isfile(pdb_seq_file_path):
133-
print(f"Missing PDB raw data, Downloading PDB sequence data....")
133+
print("Missing PDB raw data, Downloading PDB sequence data....")
134134

135135
# Create a temporary file
136136
with NamedTemporaryFile(delete=False) as tf:
@@ -146,7 +146,7 @@ def _download_pdb_sequence_data(self) -> None:
146146

147147
# Unpack the gzipped file
148148
try:
149-
print(f"Unzipping the file....")
149+
print("Unzipping the file....")
150150
with gzip.open(temp_filename, "rb") as f_in:
151151
output_file_path = pdb_seq_file_path
152152
with open(output_file_path, "wb") as f_out:
@@ -422,7 +422,7 @@ def _graph_to_raw_dataset(self, graph: nx.DiGraph) -> pd.DataFrame:
422422
Raises:
423423
RuntimeError: If no sunids are selected.
424424
"""
425-
print(f"Process graph")
425+
print("Process graph")
426426

427427
selected_sun_ids_per_lvl = self.select_classes(graph)
428428

@@ -665,8 +665,8 @@ def _get_data_splits(self) -> Tuple[pd.DataFrame, pd.DataFrame, pd.DataFrame]:
665665
)
666666
except FileNotFoundError:
667667
raise FileNotFoundError(
668-
f"File data.pt doesn't exists. "
669-
f"Please call 'prepare_data' and/or 'setup' methods to generate the dataset files"
668+
"File data.pt doesn't exists. "
669+
"Please call 'prepare_data' and/or 'setup' methods to generate the dataset files"
670670
)
671671

672672
df_scope_version = pd.DataFrame(data_scope_version)

tutorials/data_exploration_scope.ipynb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1049,13 +1049,15 @@
10491049
},
10501050
{
10511051
"cell_type": "code",
1052-
"execution_count": 11,
1052+
"execution_count": null,
10531053
"id": "6dc3fd6c-7cf6-47ef-812f-54319a0cdeb9",
10541054
"metadata": {},
10551055
"outputs": [],
10561056
"source": [
10571057
"# You can specify a literal path for the `splits_file_path`, or if another `scope_class` instance is already defined,\n",
10581058
"# you can use its existing `splits_file_path` attribute for consistency.\n",
1059+
"from chebai_proteins.preprocessing.datasets.scope.scope import SCOPeOver2000\n",
1060+
"\n",
10591061
"scope_class_with_splits = SCOPeOver2000(\n",
10601062
" scope_version=\"2.08\",\n",
10611063
" # splits_file_path=\"data/chebi_v231/ChEBI50/processed/splits.csv\", # Literal path option\n",

0 commit comments

Comments
 (0)