Closed ilario closed 1 year ago
This is definitely a bug.
The temporary solution to is to specify the save_dir
:
rNMadaptive_20220301 = Runner(save_dir=".summit", strategy=strategyNMadaptive, experiment=emul_constr_20220301, max_iterations=20)
I think the correct solution would be to change the Runner.run
method default from saving to not saving and more clearly explain what the default saving folder is. Does that make sense?
https://github.com/sustainable-processes/summit/blob/a5e4d0ca848bf3b4c794f2975bc1790e21b0343d/summit/run.py#L134-L136
I think the correct solution would be to change the Runner.run method default from saving to not saving
Yes, I agree this would help :)
Additionally to that, a check should be added here: https://github.com/sustainable-processes/summit/blob/a5e4d0ca848bf3b4c794f2975bc1790e21b0343d/summit/run.py#L144-L145 and here: https://github.com/sustainable-processes/summit/blob/a5e4d0ca848bf3b4c794f2975bc1790e21b0343d/summit/run.py#L343-L344
But I am not sure about what should be checked, the presence of save_dir?
Hi @ilario! Do you mind checking out this PR and seeing if it works for you?
git clone https://github.com/sustainable-processes/summit.git
git fetch origin pull/227/head:fix_runner
git checkout fix_runner
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
Tested and it works for me (I did test only with and without save_dir
, I did not test each possible case) :)
When I installed it with -e
I got this error:
$ pip install -e .
Obtaining file:///home/ilario/software/summit
Installing build dependencies ... done
Checking if build backend supports build_editable ... done
ERROR: Project file:///home/ilario/software/summit has a 'pyproject.toml' and its build backend is missing the 'build_editable' hook. Since it does not have a 'setup.py' nor a 'setup.cfg', it cannot be installed in editable mode. Consider using a build backend that supports PEP 660.
but when installing it without -e
it just worked :)
Great! I probably should have written more test cases but it passes all the current ones, so I'm happy with that for now.
Description
The default location for saving stuff is not writable, on my system. And the default behavior is to save stuff on disk. In my opinion, by default, no stuff should be saved, neither temporarily, unless it is actually unavoidable.
This causes this error on my system:
A possible solution is to specify the save_dir path in the run command like:
But what I would expect is that if save_freq is unset it does not save any file at all, rather than creating it and deleting it.
In order to do so, the lines to be changed are these ones:
https://github.com/sustainable-processes/summit/blob/a5e4d0ca848bf3b4c794f2975bc1790e21b0343d/summit/run.py#L144-L145
https://github.com/sustainable-processes/summit/blob/a5e4d0ca848bf3b4c794f2975bc1790e21b0343d/summit/run.py#L178-L181
https://github.com/sustainable-processes/summit/blob/a5e4d0ca848bf3b4c794f2975bc1790e21b0343d/summit/run.py#L202-L204
https://github.com/sustainable-processes/summit/blob/a5e4d0ca848bf3b4c794f2975bc1790e21b0343d/summit/run.py#L343-L344
https://github.com/sustainable-processes/summit/blob/a5e4d0ca848bf3b4c794f2975bc1790e21b0343d/summit/run.py#L402-L408
https://github.com/sustainable-processes/summit/blob/a5e4d0ca848bf3b4c794f2975bc1790e21b0343d/summit/run.py#L430-L435
What I Did
Open VSCodium and indicate to use .venv as an environment.
Run some summit stuff.