Skip to content

Commit bac8551

Browse files
committed
remove wandb.login() calls, seems enough to do it once when initially running on new machine
fix voronoi_featurize_dataset.py df to wandb.Table conversion error due to structure column
1 parent 3a0173b commit bac8551

File tree

6 files changed

+7
-18
lines changed

6 files changed

+7
-18
lines changed

models/bowsr/test_bowsr.py

-2
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,6 @@
9898
task_type=task_type,
9999
slurm_vars=slurm_vars,
100100
)
101-
if wandb.run is None:
102-
wandb.login()
103101

104102
wandb.init(project="matbench-discovery", name=job_name, config=run_params)
105103

models/cgcnn/test_cgcnn.py

-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@
6969
"created_at": {"$gt": "2022-11-22", "$lt": "2022-11-23"},
7070
"display_name": {"$regex": "^cgcnn-robust"},
7171
}
72-
wandb.login()
7372
runs = wandb.Api().runs("janosh/matbench-discovery", filters=filters)
7473

7574
assert len(runs) == 10, f"Expected 10 runs, got {len(runs)} for {filters=}"

models/m3gnet/test_m3gnet.py

-2
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@
7575
df=dict(shape=str(df_this_job.shape), columns=", ".join(df_this_job)),
7676
slurm_vars=slurm_vars,
7777
)
78-
if wandb.run is None:
79-
wandb.login()
8078

8179
run_name = f"{job_name}-{slurm_array_task_id}"
8280
wandb.init(project="matbench-discovery", name=run_name, config=run_params)

models/megnet/test_megnet.py

-2
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@
6767
df=dict(shape=str(df_wbm_structs.shape), columns=", ".join(df_wbm_structs)),
6868
slurm_vars=slurm_vars,
6969
)
70-
if wandb.run is None:
71-
wandb.login()
7270

7371
wandb.init(project="matbench-discovery", name=job_name, config=run_params)
7472

models/voronoi/voronoi_featurize_dataset.py

+7-9
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,19 @@
1313
from matbench_discovery.slurm import slurm_submit
1414
from models.voronoi import featurizer
1515

16-
module_dir = os.path.dirname(__file__)
17-
1816
data_name = "mp" # "mp"
1917
if data_name == "wbm":
2018
data_path = f"{ROOT}/data/wbm/2022-10-19-wbm-init-structs.json.bz2"
2119
input_col = "initial_structure"
2220
elif data_name == "mp":
2321
data_path = f"{ROOT}/data/mp/2022-09-16-mp-computed-structure-entries.json.gz"
24-
input_col = "structure"
22+
input_col = "relaxed_structure"
2523

26-
slurm_array_task_count = 30
2724
debug = "slurm-submit" in sys.argv
2825
job_name = f"voronoi-features-{data_name}{'-debug' if DEBUG else ''}"
26+
module_dir = os.path.dirname(__file__)
2927
out_dir = os.environ.get("SBATCH_OUTPUT", f"{module_dir}/{today}-{job_name}")
28+
slurm_array_task_count = 50
3029

3130

3231
slurm_vars = slurm_submit(
@@ -70,9 +69,8 @@
7069
df=dict(shape=str(df_this_job.shape), columns=", ".join(df_this_job)),
7170
input_col=input_col,
7271
slurm_vars=slurm_vars,
72+
out_path=out_path,
7373
)
74-
if wandb.run is None:
75-
wandb.login()
7674

7775
wandb.init(project="matbench-discovery", name=run_name, config=run_params)
7876

@@ -82,11 +80,11 @@
8280
warnings.filterwarnings(action="ignore", category=UserWarning, module="pymatgen")
8381

8482
df_features = featurizer.featurize_dataframe(
85-
df_this_job, input_col, ignore_errors=True, pbar=dict(position=0, leave=True)
86-
)
83+
df_this_job, input_col, ignore_errors=True
84+
)[featurizer.feature_labels()].round(6)
8785

8886

8987
# %%
90-
df_features[featurizer.feature_labels()].to_csv(out_path)
88+
df_features.to_csv(out_path)
9189

9290
wandb.log({"voronoi_features": wandb.Table(dataframe=df_features)})

models/wrenformer/test_wrenformer.py

-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@
5151

5252

5353
# %%
54-
wandb.login()
55-
5654
filters = {
5755
"created_at": {"$gt": "2022-11-15", "$lt": "2022-11-16"},
5856
"display_name": {"$regex": "wrenformer-robust"},

0 commit comments

Comments
 (0)