Make Setas a descriptor; add ColumnHeadersDescriptor; merge stable#35
Merged
Conversation
- Add __set_name__, __get__, __set__ to Setas; optional source= parameter enables the delegating pattern used by DataFilePropertyMixin. - Add ColumnHeadersDescriptor that forwards column_headers through setas. - Replace setas and column_headers @Property definitions in DataArray and DataFilePropertyMixin with class-level descriptor instances. - All 17 core tests pass; 0 CodeQL alerts. Co-authored-by: gb119 <4428426+gb119@users.noreply.github.com> Agent-Logs-Url: https://github.com/stonerlab/Stoner-PythonCode/sessions/aad8e39f-bc8b-4a7d-a751-a42960d3c001
Copilot
AI
changed the title
[WIP] Refactor setas attribute to use descriptor pattern
Make Mar 21, 2026
Setas a descriptor; add ColumnHeadersDescriptor
Resolve conflict in Stoner/core/property.py by combining: - Our Setas(source="_data") and ColumnHeadersDescriptor() class-level descriptors for setas and column_headers - Stable's DataArray([]) class-level descriptor for data (replaces the @Property data getter/setter) The DataArray descriptor protocol (__set_name__, __get__, __set__) brought in from stable handles the data normalisation previously done by the @Property setter in DataFilePropertyMixin. Co-authored-by: gb119 <4428426+gb119@users.noreply.github.com> Agent-Logs-Url: https://github.com/stonerlab/Stoner-PythonCode/sessions/99c326bd-f943-4982-bcb3-efcaa9f75225
Copilot
AI
changed the title
Make
Make Mar 21, 2026
Setas a descriptor; add ColumnHeadersDescriptorSetas a descriptor; add ColumnHeadersDescriptor; merge stable
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.
The
setasattribute was implemented as a@propertyin two separate places (DataArray,DataFilePropertyMixin), scattering the get/set logic outside theSetasclass.column_headershad the same problem. This PR makesSetasitself a Python descriptor and introducesColumnHeadersDescriptor, then merges the stable branch (which independently madeDataArraya descriptor for thedataattribute).Setasas a descriptor (setas.py)__set_name__,__get__,__set__toSetas.__get__retrieves the per-instanceSetasstored as_setas, shape-syncing on access.__set__delegates toSetas.__call__, preserving all existing assignment call-convention logic.sourcekwarg:Setas(source="_data")makes get/set forward throughgetattr(obj, source).setas— used byDataFilePropertyMixinto reach its innerDataArray.ColumnHeadersDescriptor(setas.py)New slim descriptor exposing
column_headersuniformly viaobj.setas.column_headers.DataArray(array.py)Replaced the
setasandcolumn_headers@propertypairs with class-level descriptors:Also incorporates
DataArray.__set_name__/__get__/__set__from stable, enablingDataArrayitself to act as a descriptor for thedataattribute onDataFilePropertyMixin.DataFilePropertyMixin(property.py)Replaced the
setas,column_headers, anddata@propertydefinitions with class-level descriptors:The
datadescriptor's__set__handles the shape normalisation and setas/column-header preservation previously done by the@property datasetter.Merge with
stableOne conflict in
property.pyresolved by keeping oursetas/column_headersdescriptors and stable'sdata = DataArray([])form, dropping both the old@property datagetter/setter and the intermediate@property column_headers.📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.