-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
produce_or_load doubles filename prefixes #392
Comments
oh shit this looks like a super duper major bug that we have to fix asap. it may break people's code when we fix it but we have to!!! And we have to put a test for it as well!!!!!!!!!!! |
@pjgorski your solution is correct! Could you please open a PR? |
I think this bug was introduced when we allowed |
This is still (or again, perhaps) broken on using DrWatson
struct Experiment end
DrWatson.default_prefix(::Experiment) = "Experiment"
filename(c) = savename(c; connector=" ")
produce(::Experiment) = Dict("data" => randn())
produce_or_load(produce, Experiment()) # good
produce_or_load(produce, Experiment(); filename) # bad |
@jonas-schulze if you put in a PR together and add a test for it we can see if anything breaks! |
Describe the bug
When a
config
variabledefault_prefix
is modified, thenproduce_or_load
saves the output to a file with a name starting with two prefixes instead of one.Minimal Working Example
As a result following files are saved:
A2=36_B2=10.0_C2=test.jld2
andExperiment_2023-06-30_Experiment_2023-06-30_A=36_B=10.0_C=test.jld2
.The first file is the result of saving
Params2
for whichdefault_prefix
was not modified. The second file has the prefix repeated.Versions
DrWatson 2.12.5
Julia 1.6.4
Proposed solution
I propose moving line 91 in file
saving_files.jl
to line 87, and changing line 83, so they would be:The reason for that is that
savename
function runsdefault_prefix(c)
by itself.The text was updated successfully, but these errors were encountered: