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

Internal Cache Flag #52

Merged
merged 15 commits into from
Mar 2, 2025
Merged

Internal Cache Flag #52

merged 15 commits into from
Mar 2, 2025

Conversation

AHReccese
Copy link
Member

Reference Issues/PRs

#50

What does this implement/fix? Explain your changes.

Any other comments?

@AHReccese AHReccese added this to the opr v0.4 milestone Feb 20, 2025
@AHReccese AHReccese self-assigned this Feb 20, 2025
@codecov-commenter
Copy link

codecov-commenter commented Feb 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (ce54d15) to head (70a6ed5).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev       #52   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            5         5           
  Lines          180       194   +14     
  Branches        23        25    +2     
=========================================
+ Hits           180       194   +14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

opr/primer.py Outdated
@@ -274,10 +305,13 @@ def melting_temperature(self, method=MeltingTemperature.BASIC):
:type method: MeltingTemperature
:return: approximated melting temperature
"""
if self._melting_temperature[method] is not None:
if method not in self._computed["melting_temperature"]:
raise OPRBaseError(PRIMER_INVALID_MELTING_TEMPERATURE_METHOD_ERROR)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This error and raise NotImplementedError(PRIMER_MELTING_TEMPERATURE_NOT_IMPLEMENTED_ERROR) are very similar; please properly merge them. I suggest raising only NotImplementedError.

CHANGELOG.md Outdated
- `_computed` internal cache flag attribute
- `is_computed` method
### Changed
- Cache structure in Primer
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

`Primer` class

Copy link
Member

@sepandhaghighi sepandhaghighi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AHReccese
Please resolve this pull request conflicts and then ping me so I can complete my review 🔥

@AHReccese AHReccese requested a review from sepandhaghighi March 1, 2025 05:45
opr/params.py Outdated
@@ -26,3 +26,5 @@
PRIMER_MULTIPLICATION_ERROR = "The primer sequence can only be multiplied by an integer."

PRIMER_MELTING_TEMPERATURE_NOT_IMPLEMENTED_ERROR = "This method for calculating melting temperature has not been implemented."

PRIMER_ATTRIBUTE_NOT_COMPUTABLE_ERROR = "This attribute either doesn't exist or cannot be computed/cached (e.g., name)."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My suggestion:

This attribute either doesn't exist or cannot be computed/cached (e.g., name).

opr/primer.py Outdated
@@ -11,6 +11,8 @@
from .params import DNA_COMPLEMENT_MAP
from .params import PRIMER_ADDITION_ERROR, PRIMER_MULTIPLICATION_ERROR
from .params import PRIMER_MELTING_TEMPERATURE_NOT_IMPLEMENTED_ERROR

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this blank like

@AHReccese AHReccese requested a review from sepandhaghighi March 2, 2025 09:48
Copy link
Member

@sepandhaghighi sepandhaghighi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

@sepandhaghighi sepandhaghighi merged commit 19b0ddb into dev Mar 2, 2025
24 checks passed
@sepandhaghighi sepandhaghighi deleted the add/internal_cache_flag branch March 2, 2025 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants