`overwrite` parameter doesn't behave as expected

Open
#430 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
backend

Research direction

Start with src/muse/outputs/sinks.py at the linked line and read the output configuration documentation for the csv and aggregate sinks. Reproduce the behavior with an omitted overwrite setting and an existing output file; done means the effective behavior is consistent with the documented scope, with the desired global-versus-per-output setting clarified.

Written by the indexing model from the issue text.

Description

bug

This parameter is used on a per-output basis to control whether the program will overwrite existing files. See here

If you set this as false then the program will refuse to overwrite existing files and will abort, as expected. However, if this parameter is not specified, then it appears to default to true (i.e. overwriting existing files), despite what the documentation says. Not sure what's going on though, because this line looks like it's taking False as the default:

https://github.com/EnergySystemsModellingLab/MUSE_OS/blob/48095f6136ee634259d5a37a507ef377907b18f0/src/muse/outputs/sinks.py#L120

So clearly something is broken somewhere.

In any case, it seems strange to have this setting on a per-output basis. I think it would make much more sense as a global setting (i.e. if false, no files will be overwritten)

Update: Actually, the documentation does say that the overwrite parameter only applies to the "csv" sink (not the "aggregate" sink), which I missed before. Still, I'm leaving this issue up as I still think things could be improved here.

Dominant language
Python
Stars
29
Forks
12
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from EnergySystemsModellingLab/MUSE_OS

All issues in EnergySystemsModellingLab/MUSE_OS

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.