Skip to content

Commit 878fa96

Browse files
committed
add check for time interval
1 parent 6b1912c commit 878fa96

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

proteinworkshop/config/dataset/pdb.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ datamodule:
1010

1111
pdb_dataset:
1212
_target_: "proteinworkshop.datasets.pdb_dataset.PDBData"
13-
fraction: 1.0 # Fraction of dataset to use
13+
fraction: 0.01 # Fraction of dataset to use
1414
molecule_type: "protein" # Type of molecule for which to select
1515
experiment_types: ["diffraction", "NMR", "EM", "other"] # All experiment types
16-
max_length: 1000 # Exclude polypeptides greater than length 1000
16+
max_length: 150 # Exclude polypeptides greater than length 1000
1717
min_length: 10 # Exclude peptides of length 10
1818
oligomeric_min: 1 # Include only monomeric proteins
1919
oligomeric_max: 5 # Include up to 5-meric proteins

proteinworkshop/datasets/pdb_dataset.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,13 @@ def __init__(
5555
self.split_type = split_type
5656
self.split_sequence_similarity = split_sequence_similiarity
5757
self.overwrite_sequence_clusters = overwrite_sequence_clusters
58-
self.split_time_frames = [np.datetime64(date) for date in split_time_frames]
58+
if split_time_frames is None:
59+
self.split_time_frames = split_time_frames
60+
else:
61+
try:
62+
self.split_time_frames = [np.datetime64(date) for date in split_time_frames]
63+
except:
64+
raise TypeError(f"{split_time_frames} does not contain valid dates for np.datetime64 format")
5965
self.splits = ["train", "val", "test"]
6066

6167
def create_dataset(self):

0 commit comments

Comments
 (0)