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

feat: precomp attrs and write_annotations refinements #879

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

JoeStrout
Copy link
Contributor

  1. Refactored LineAnnotation and AnnotationLayer to make use of attrs
  2. AnnotationLayer.write_annotations now raises a ValueError if you supply a bounding box to clear, and any annotations are partially or fully outside that bounds
  3. The annotations PUT endpoint silently discards any annotations not within the specified bounds.

Copy link

codecov bot commented Jan 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (303511d) to head (7d091da).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #879   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          143       143           
  Lines         6130      6135    +5     
=========================================
+ Hits          6130      6135    +5     

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

@JoeStrout JoeStrout force-pushed the joe/feat_precomp_attrs branch from 41e1649 to 7d091da Compare January 29, 2025 15:22
index: VolumetricIndex
chunk_sizes: Sequence[Sequence[int]]
path: str = ""

def __init__(
Copy link
Member

Choose a reason for hiding this comment

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

The canonical way to do it is to still use attrs.define(init=True) and add an __attrs_post_innit__ that performs complex checks and re-sets variables.

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.

2 participants