Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions ext/pytests/test_secondary_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@


def folder_pairs(folder):
filename_parts = (f.stem.split("_") for f in folder.glob("*"))
return (
(int(split[0]), int(split[1]))
for split in (f.stem.split("_") for f in folder.glob("*"))
(int(split[0].replace("m", "-")), int(split[1])) for split in filename_parts
)


Expand Down Expand Up @@ -34,11 +34,11 @@ def test_secondary_job(tmp_path, monkeypatch):
"secondary_composites",
"secondary_intermediates",
]:
for s, t in folder_pairs(tmp_path / folder):
assert t - s <= max_stems
for n, _ in folder_pairs(tmp_path / folder):
assert n <= max_stems

for s, _ in folder_pairs(tmp_path / "secondary_composites"):
for _, s in folder_pairs(tmp_path / "secondary_composites"):
assert s == goal_stem

for s, _ in folder_pairs(tmp_path / "secondary_intermediates"):
for _, s in folder_pairs(tmp_path / "secondary_intermediates"):
assert s == goal_stem + 1
11 changes: 7 additions & 4 deletions ext/src/save.rs
Original file line number Diff line number Diff line change
Expand Up @@ -397,19 +397,22 @@ impl<A: Algebra> SaveFile<A> {

/// This panics if there is no save dir
fn get_save_path(&self, mut dir: PathBuf) -> PathBuf {
let n = if self.b.n() < 0 {
format!("m{}", -self.b.n())
} else {
self.b.n().to_string()
};
if let Some(idx) = self.idx {
dir.push(format!(
"{name}s/{s}_{t}_{idx}_{name}",
"{name}s/{n}_{s}_{idx}_{name}",
name = self.kind.name(),
s = self.b.s(),
t = self.b.t()
));
} else {
dir.push(format!(
"{name}s/{s}_{t}_{name}",
"{name}s/{n}_{s}_{name}",
name = self.kind.name(),
s = self.b.s(),
t = self.b.t()
));
}
dir
Expand Down
2 changes: 1 addition & 1 deletion ext/tests/save_load_resolution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ fn test_checksum() {
.compute_through_bidegree(Bidegree::s_t(2, 2));

let mut path = tempdir.path().to_owned();
path.push("differentials/2_2_differential");
path.push("differentials/0_2_differential");

let mut file = OpenOptions::new()
.read(true)
Expand Down
Loading