Skip to content

feat: add reuse flag to override gallery flag#1564

Merged
dipinknair merged 8 commits intomainfrom
feat/gallery-flag
Apr 10, 2026
Merged

feat: add reuse flag to override gallery flag#1564
dipinknair merged 8 commits intomainfrom
feat/gallery-flag

Conversation

@dipinknair
Copy link
Copy Markdown
Collaborator

@dipinknair dipinknair commented Mar 24, 2026

Close #1378


What changed

Adds reuse_instance on embedded App: when BUILDING_GALLERY is True, passing reuse_instance=True skips the gallery instance-sharing path for that constructor (same effect as not using gallery sharing for that call), without setting BUILDING_GALLERY to False globally.

Examples

Opt out of gallery sharing for one App while the flag stays on:

import ansys.mechanical.core as pymechanical

pymechanical.BUILDING_GALLERY = True
app = pymechanical.App(version=252, globals=globals(), reuse_instance=True)

Default (unchanged): reuse_instance=False — gallery sharing still follows BUILDING_GALLERY.

Tests & docs

@dipinknair dipinknair requested a review from a team as a code owner March 24, 2026 01:03
@github-actions github-actions bot added documentation Improvements or additions to documentation enhancement New features or code improvements labels Mar 24, 2026
@github-actions
Copy link
Copy Markdown

Pull request documentation preview limit (10) reached: skipping documentation deployment for this pull request.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.32%. Comparing base (f3a3696) to head (1efdddf).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1564   +/-   ##
=======================================
  Coverage   80.31%   80.32%           
=======================================
  Files          42       42           
  Lines        3196     3197    +1     
=======================================
+ Hits         2567     2568    +1     
  Misses        629      629           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dipinknair dipinknair requested a review from klmcadams March 24, 2026 16:35
@dipinknair dipinknair requested a review from koubaa March 25, 2026 01:21
@codacy-production
Copy link
Copy Markdown

codacy-production bot commented Apr 6, 2026

Not up to standards ⛔

🔴 Issues 1 minor

Alerts:
⚠ 1 issue (≤ 0 issues of at least minor severity)

Results:
1 new issue

Category Results
UnusedCode 1 minor

View in Codacy

🟢 Metrics 0 complexity

Metric Results
Complexity 0

View in Codacy

🟢 Coverage 100.00% diff coverage · +0.01% coverage variation

Metric Results
Coverage variation +0.01% coverage variation (-1.00%)
Diff coverage 100.00% diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (f3a3696) 3196 2567 80.32%
Head commit (1efdddf) 3197 (+1) 2568 (+1) 80.33% (+0.01%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#1564) 3 3 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

TIP This summary will be updated as you push new changes. Give us feedback

@github-actions github-actions bot added maintenance Package and maintenance related ci/cd Involves the GitHub workflow files labels Apr 10, 2026
@dipinknair dipinknair enabled auto-merge (squash) April 10, 2026 17:12
@dipinknair dipinknair merged commit 2088859 into main Apr 10, 2026
60 of 61 checks passed
@dipinknair dipinknair deleted the feat/gallery-flag branch April 10, 2026 17:25
@github-actions
Copy link
Copy Markdown

The documentation for this pull request will be available at https://mechanical.docs.pyansys.com/pull/1564. Please allow some time for the documentation to be deployed.

@pyansys-ci-bot
Copy link
Copy Markdown
Collaborator

This PR has been closed. Documentation for this pull request will shortly be removed from its former deployment address.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/cd Involves the GitHub workflow files documentation Improvements or additions to documentation enhancement New features or code improvements maintenance Package and maintenance related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add argument that has same functionality as BUILDING_GALLERY

4 participants