Skip to content

Conversation

@evvaaaa
Copy link
Contributor

@evvaaaa evvaaaa commented Nov 25, 2024

Closes #89

@evvaaaa evvaaaa marked this pull request as draft November 25, 2024 14:16
@codecov
Copy link

codecov bot commented Nov 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.75%. Comparing base (35b1870) to head (f45ac5c).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #91      +/-   ##
==========================================
+ Coverage   87.60%   87.75%   +0.14%     
==========================================
  Files          28       28              
  Lines        1170     1184      +14     
==========================================
+ Hits         1025     1039      +14     
  Misses        145      145              

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

@evvaaaa evvaaaa force-pushed the 89-change-how-we-search-for-attributes branch from 7e66f35 to a02b447 Compare November 26, 2024 13:43
@evvaaaa evvaaaa changed the title WIP Change how we search for attributes Nov 26, 2024
@evvaaaa evvaaaa force-pushed the 89-change-how-we-search-for-attributes branch from a02b447 to 8a0c003 Compare November 26, 2024 14:31
@evvaaaa evvaaaa marked this pull request as ready for review November 26, 2024 14:31
@evvaaaa evvaaaa requested a review from GDYendell November 26, 2024 14:32
@evvaaaa evvaaaa force-pushed the 89-change-how-we-search-for-attributes branch 2 times, most recently from 779073f to 0edc27c Compare November 26, 2024 15:08
@evvaaaa evvaaaa marked this pull request as draft November 26, 2024 15:51
@evvaaaa
Copy link
Contributor Author

evvaaaa commented Nov 26, 2024

Will make this a draft while I write docs and make branches on eiger and odin.

Copy link
Contributor

@GDYendell GDYendell left a comment

Choose a reason for hiding this comment

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

I think it might be nicer to add these attributes to an _attributes member dict in __init__ rather than have a getter and then manually adding them to the member attribute on access. All the messy logic of searching through dir(), checking for clashes and filtering of root_attribute could be done in one place (_bind_attrs) instead of in Mapping.

It also occurs to me that we aren't gaining anything by making root_attribute a property, because we still have to check for "root_attribute" anyway. So, maybe it could just be a class member on SubController with default None.

Thoughts?

@evvaaaa
Copy link
Contributor Author

evvaaaa commented Nov 27, 2024

I think it might be nicer to add these attributes to an _attributes member dict in init rather than have a getter

I agree this would definitely be nicer, still not containing any of the attributes defined globally in the class though.

It also occurs to me that we aren't gaining anything by making root_attribute a property, because we still have to check for "root_attribute" anyway. So, maybe it could just be a class member on SubController with default None.

Would also probably be nicer. We would still have to filter it out when searching through all the attributes on the type(controller).

@evvaaaa evvaaaa force-pushed the 89-change-how-we-search-for-attributes branch 2 times, most recently from da21c22 to 8110e2e Compare December 2, 2024 11:22
@evvaaaa evvaaaa requested a review from GDYendell December 2, 2024 11:23
@evvaaaa evvaaaa force-pushed the 89-change-how-we-search-for-attributes branch from 8110e2e to 6489767 Compare December 2, 2024 11:24
@evvaaaa evvaaaa marked this pull request as ready for review December 2, 2024 11:24
@evvaaaa evvaaaa force-pushed the 89-change-how-we-search-for-attributes branch 3 times, most recently from 6756c68 to 4d09743 Compare December 2, 2024 11:54
@evvaaaa evvaaaa force-pushed the 89-change-how-we-search-for-attributes branch from 4d09743 to 817d7da Compare December 4, 2024 11:12
@evvaaaa evvaaaa requested a review from GDYendell December 4, 2024 11:13
@evvaaaa evvaaaa force-pushed the 89-change-how-we-search-for-attributes branch from 817d7da to 5243d6a Compare December 4, 2024 11:15
`root_attribute` is parsed on `register_sub_controller`
@evvaaaa evvaaaa force-pushed the 89-change-how-we-search-for-attributes branch from 5243d6a to f45ac5c Compare December 4, 2024 11:17
@GDYendell GDYendell merged commit baebfaa into main Dec 4, 2024
17 checks passed
@GDYendell GDYendell deleted the 89-change-how-we-search-for-attributes branch December 4, 2024 13:55
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.

Proposal for changing how we search for attributes

3 participants