Protocol Export from Protocol Developer#161
Open
Rohit-Kannachel wants to merge 3 commits intofeat-nysbc-feedbackfrom
Open
Protocol Export from Protocol Developer#161Rohit-Kannachel wants to merge 3 commits intofeat-nysbc-feedbackfrom
Rohit-Kannachel wants to merge 3 commits intofeat-nysbc-feedbackfrom
Conversation
…a easier to read yaml file from protocol developer
patrickcleeve2
requested changes
Jun 16, 2025
| if current_milling_dict is None: | ||
| current_milling_dict = {k: get_protocol_from_stages(v) for k, v in self.milling.items()} | ||
|
|
||
| milling_dict = self._reduced_milling_options_dict(current_milling_dict) |
Contributor
There was a problem hiding this comment.
I don't agree with always removing these options from the dict, as others use the alignment/imaging settings. Instead of specifying method.name =="Waffle" (L1013), can you just add a flag here to remove the options for your use case. If it stays the way it is, it's gonna cause some silent issues later on
There was a problem hiding this comment.
Pull Request Overview
Adds a streamlined export path for protocols by introducing methods to generate and save a base (less verbose) YAML representation of an experiment.
- Introduces
save_base_protocolto write out a simplified protocol file - Implements
to_dict_base_protocoland helper_reduced_milling_options_dictfor pared-down dictionary output - Retains full export via
saveand ensures backward compatibility
Comments suppressed due to low confidence (3)
autolamella/structures.py:1000
- [nitpick] The attribute
tmpis ambiguous. Consider renaming it to something more descriptive (e.g.,default_optionsortemplate_options).
options_dict = self.tmp
autolamella/structures.py:1007
- Add a docstring explaining the purpose, parameters, and return value of this helper to improve maintainability.
def _reduced_milling_options_dict(self,milling_dict):
autolamella/structures.py:985
- Consider adding unit tests for
save_base_protocolandto_dict_base_protocolto verify the reduced YAML structure is generated correctly.
def save_base_protocol(self, path: Path, current_milling_dict: dict = None) -> None:
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Tried to implement a less complex protocol file export function to create an easier to read yaml file from protocol developer