Skip to content

Commit

Permalink
[fix] address pandas warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
kierandidi committed May 29, 2024
1 parent c4aea57 commit 0ca75eb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions graphein/ml/datasets/pdb_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ def _parse_entries(self) -> Dict[str, datetime]:
df.dropna(subset=["id"], inplace=True)

df.id = df.id.str.lower()
df.date = pd.to_datetime(df.date)
df.date = pd.to_datetime(df.date, format = "%m/%d/%y")
return pd.Series(df["date"].values, index=df["id"]).to_dict()

def _parse_experiment_type(self) -> Dict[str, str]:
Expand Down Expand Up @@ -704,7 +704,7 @@ def parse(self, labels: List[str]) -> pd.DataFrame:
df["deposition_date"] = df.pdb.map(self._parse_entries())
df["experiment_type"] = df.pdb.map(self._parse_experiment_type())
df["pdb_file_available"] = df.pdb.map(self._parse_pdb_availability())
df.pdb_file_available.fillna(True, inplace=True)
df["pdb_file_available"] = df["pdb_file_available"].fillna(True)
if labels:
if "uniprot_id" in labels:
df["uniprot_id"] = df.id.map(self._parse_uniprot_id())
Expand Down Expand Up @@ -1771,8 +1771,8 @@ def reset(self) -> pd.DataFrame:

def download_pdbs(
self,
out_dir=".",
format="pdb",
out_dir: str = ".",
format: str = "pdb",
splits: Optional[List[str]] = None,
overwrite: bool = False,
max_workers: int = 8,
Expand Down

0 comments on commit 0ca75eb

Please sign in to comment.