Skip to content

PR-R2: Load viewer representations from extras - #769

Open
cpignedoli wants to merge 2 commits into
feature/encoded-representation-style-idsfrom
feature/load-viewer-representations-from-extras
Open

PR-R2: Load viewer representations from extras#769
cpignedoli wants to merge 2 commits into
feature/encoded-representation-style-idsfrom
feature/load-viewer-representations-from-extras

Conversation

@cpignedoli

Copy link
Copy Markdown
Member

What

PR-R2 in the representation split. This is stacked on top of #768 (feature/encoded-representation-style-ids).

This PR teaches the structure viewer/manager to read viewer representation masks from AiiDA node extras and to clean stale representation rows when switching between structures.

Why

Encoded representation arrays already survive file upload/download, but stored AiiDA nodes need an extras-based path because get_ase() does not preserve custom viewer state by itself.

This PR intentionally only reads/restores that state. Writing it is kept for the next PR in the chain.

Chain

Implemented with Codex.

Validation

python -m pytest tests/test_viewers.py tests/test_structures.py

Result: 35 passed, 20 warnings.

@codecov

codecov Bot commented Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 71.42857% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.35%. Comparing base (e0f78bb) to head (d3b7be4).

Files with missing lines Patch % Lines
aiidalab_widgets_base/viewers.py 76.47% 4 Missing ⚠️
aiidalab_widgets_base/structures.py 50.00% 2 Missing ⚠️
Additional details and impacted files
@@                             Coverage Diff                              @@
##           feature/encoded-representation-style-ids     #769      +/-   ##
============================================================================
- Coverage                                     85.40%   85.35%   -0.06%     
============================================================================
  Files                                            18       18              
  Lines                                          3379     3393      +14     
============================================================================
+ Hits                                           2886     2896      +10     
- Misses                                          493      497       +4     
Flag Coverage Δ
python-3.12 85.32% <71.42%> (-0.06%) ⬇️
python-3.9 85.33% <71.42%> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cpignedoli
cpignedoli requested a review from yakutovicha June 25, 2026 08:41
@cpignedoli
cpignedoli marked this pull request as ready for review June 25, 2026 08:42
@cpignedoli
cpignedoli marked this pull request as draft June 25, 2026 08:43
@cpignedoli
cpignedoli marked this pull request as ready for review June 25, 2026 09:08
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