Skip to content
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

Feature: Separate pyplate.py into Multiple Files #32

Merged
merged 2 commits into from
Aug 26, 2024

Conversation

jlw387
Copy link
Collaborator

@jlw387 jlw387 commented Aug 26, 2024

Due to the length of the main implementation file, pyplate.py, it seemed well worth it to distribute the various classes across separate files. Most classes were given their own files, but some (e.g. Recipe/RecipeStep and Plate/PlateSlicer) were kept in the same file if they were closely coupled.

To achieve this separation, some circular references across classes needed to be handled. The instances of this were:

  1. Unit and Container -> Resolved by removing the ability to pass a Container instance as an input to Unit.convert_from_storage_to_standard_format()

  2. Container and Plate/PlateSlicer -> Resolved by using if typing.TYPE_CHECKING and importing the modules at runtime only in the functions where they are used (e.g. Container.transfer() and Container._transfer_slice()).

Moreover, for many of the unit test files and example files, the import statements were changed to reference the overall pyplate module rather than the specific file, pyplate.pyplate.

jlw387 added 2 commits August 23, 2024 22:38
Created separate files for the various classes of PyPlate. Some which were closely paired (e.g. Recipe and RecipeStep) were kept in the same file, whereas most others were given their own files. NOTE: There were some circular dependency issues between Container and Plate/PlateSlicer that were circumvented with the use of typing.TYPE_CHECKING, may want to refactor more heavily in the future to resolve the circular dependency issue.
@jlw387 jlw387 self-assigned this Aug 26, 2024
@jlw387
Copy link
Collaborator Author

jlw387 commented Aug 26, 2024

All status checks have passed. This branch will now be merged into the development branch and the branch will be deleted.

@jlw387 jlw387 merged commit 327942d into development Aug 26, 2024
3 checks passed
@jlw387 jlw387 deleted the feature_separate_files branch August 26, 2024 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant