-
Notifications
You must be signed in to change notification settings - Fork 10
history updated just if acquisition succeeded #1401
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
Draft
lballerio
wants to merge
2
commits into
main
Choose a base branch
from
update_history_before_each_task_run
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+12
−2
Draft
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
modeis aFlagenum, specifically of typeExecutionMode.Instead of making it an empty list, which is succeeding in the current usage, but just broadening the type hint, create instead an instance of
ExecutionMode.If you want to keep it empty as a default (which is a choice), it is possible to create the equivalent enum variant, e.g. with
ExecutionMode.ACQUISITION & ExecutionMode.FIT(empty intersection).It is a bit convoluted, and because of this in py3.11 on you can do
ExecutionMode(0). But we still support also py3.10Btw: the reason not to put an empty list as default argument is because it is a mutable object, and it would be shared by all calls (search this online, you will find plenty of references and examples). However,
ExecutionModeinstances should not be mutable, because they are essentially integers. So, that one could be set even as default argument, and you could avoid both theOptionaland the default toNone. Though that's also a choice: sometimes having a special value for the unset state is useful. But, in my experience, better to avoid whenever not explicitly neededThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
then what about using a tuple?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean a tuple of Booleans? That's exactly what a flag is, essentially a bitstring :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was more thinking about changing the default value to an empty tuple, which then is immutable and will be fine with the immutability condition, on which by the way I completely agree.
The thing is that there is a clear inconsistency in the default value for variable
mode, since if you don't assign any value the code will crash because of the command:Then, I don't know if this condition might be forced or is suppressed in higher levels in the code.
Also, the main purpose of this small PR is to put acquisition as necessary and sufficient condition for updating the history in the output folder.