Skip to content

Skip publish job on non-tag pushes in PyPI workflow - #70

Merged
mkofler96 merged 4 commits into
mainfrom
copilot/fix-publishing-failure
Jul 10, 2026
Merged

Skip publish job on non-tag pushes in PyPI workflow#70
mkofler96 merged 4 commits into
mainfrom
copilot/fix-publishing-failure

Conversation

Copilot AI commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

The publish GitHub Actions job was failing on main pushes because it executed tag validation against a branch ref (main). This change scopes publishing to tag refs so non-release pushes skip publish cleanly.

  • Root cause

    • publish.yml triggers on both main and v* tags, but the publish job always ran and enforced vX.Y.Z tag format.
  • Workflow change

    • Added a job-level guard to run publish only for tag refs.
    • Branch pushes still run tests via needs: test, but publishing is skipped.
  • Behavior after change

    • push to main: publish job is skipped.
    • push of vX.Y.Z tag: publish job runs as before.
publish:
  needs: test
  if: github.ref_type == 'tag'
  runs-on: ubuntu-latest

@deepsource-io

deepsource-io Bot commented Jul 10, 2026

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in 52a1384...44f76ba on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
Python Jul 10, 2026 12:36p.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

Copilot AI and others added 2 commits July 10, 2026 11:21
Co-authored-by: mkofler96 <18218171+mkofler96@users.noreply.github.com>
Co-authored-by: mkofler96 <18218171+mkofler96@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing GitHub Actions job publish Skip publish job on non-tag pushes in PyPI workflow Jul 10, 2026
Copilot AI requested a review from mkofler96 July 10, 2026 11:23
Co-authored-by: mkofler96 <18218171+mkofler96@users.noreply.github.com>
@mkofler96
mkofler96 marked this pull request as ready for review July 10, 2026 12:48
Copilot AI review requested due to automatic review settings July 10, 2026 12:48
@mkofler96
mkofler96 merged commit 8e73ef9 into main Jul 10, 2026
4 checks passed
@mkofler96
mkofler96 deleted the copilot/fix-publishing-failure branch July 10, 2026 12:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the PyPI publish workflow to avoid running the publish job on non-tag pushes, preventing the release tag validation step from failing on branch refs like main.

Changes:

  • Add a job-level if: github.ref_type == 'tag' guard to the publish job.
  • Keep test running on main pushes while cleanly skipping publishing unless the ref is a tag.

mkofler96 added a commit that referenced this pull request Jul 14, 2026
* fix bounds slicing for xmin and xmax calculations (#64)

* Add homogenization (#65)

* Add test experiment for homogenization model with training artifacts

- Introduced new experiment directory for testing homogenization.
- Added latest model, optimizer parameters, latent codes, and logs as binary files.
- Created specs.json to define network architecture and training parameters.
- Added training summary in training_summary.json.
- Implemented a test function to train the homogenization model in test_train_model.py.

* Add homogenization network and update training loss calculation

* added xlim option back to plot sdf

* Update test experiment specs and data directory for homogenization model

* Refactor homogenization model tests to use shared data directory fixture

* set default dtype to float32 in test train model

* reduced test duration by reducing sampling points

* fix retry 429 error

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix negative Jacobian at mesh resolution 10 by filtering tets in float64

The orientation check ran in float32 but torchfem evaluates Jacobians in
float64 (after verts.to(float64)). Tets with a tiny positive float32
volume can flip negative in float64, causing the "Negative Jacobian"
exception. Compute the final validity mask in float64 so the filter is
consistent with torchfem.

* added HF secret

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>

* Fix wrong module loading (#66)

* Refactor model loading to handle module prefix in state_dict more efficiently

* added some additional output checks for the model export

* replaced deprecated torch.linalg.norm argument axes

* Fix type comparison in optimization (#67)

* Fix type comparison

* Add previous type checks for compatibility reasons

---------

Co-authored-by: Aron Längert <e11916873@student.ilsb.tuwien.ac.at>

* added pypi publish workflow

* Fix publish workflow (#69)

* added pypi environment

* fixed version criteria

* added guard to only trigger on main

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Skip publish job on non-tag pushes in PyPI workflow (#70)

* Initial plan

* chore: start publish failure investigation

Co-authored-by: mkofler96 <18218171+mkofler96@users.noreply.github.com>

* fix(ci): skip publish job on branch pushes

Co-authored-by: mkofler96 <18218171+mkofler96@users.noreply.github.com>

* chore: revert unintended uv lockfile changes

Co-authored-by: mkofler96 <18218171+mkofler96@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: mkofler96 <18218171+mkofler96@users.noreply.github.com>

* add threshold_factor argument

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: Michael Kofler <michael.kofler@tuwien.ac.at>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Aron Längert <e11916873@student.ilsb.tuwien.ac.at>
Co-authored-by: Michael Kofler <rasta.kof@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: mkofler96 <18218171+mkofler96@users.noreply.github.com>
mkofler96 added a commit that referenced this pull request Jul 15, 2026
* Fix inverted tetrahedra in FlexiCubes volume mesh output

FlexiCubes' _tetrahedralize builds tets from two sub-procedures (surface
pyramids and interior edges) whose vertex orderings do not share a
consistent winding. As a result a large fraction of elements came out
inverted (negative signed volume) - nearly all surface tets and ~40% of
interior tets - which breaks FEA solvers that require a positive signed
volume / Jacobian on every element.

Add _orient_tets to normalize every tet to positive orientation by
swapping two vertices where the signed volume is negative. This only
reorders integer indices, so element geometry, |volume|, and gradients
to the vertices are all preserved (the extractor stays differentiable).

Add regression tests asserting no inverted tets are produced.

* Remove degenerate zero-volume tets from FlexiCubes output

The interior tetrahedralization sub-procedure can emit elements whose
four vertices are exactly coplanar (the two dual-mesh vertices land
symmetric about the grid edge), yielding zero-volume tets that fail the
positive-Jacobian requirement of FEA solvers just like inverted ones.

Drop these elements in _orient_tets and log
'removed x elements with 0 volume'. Coplanarity is detected with a
tolerance relative to the Hadamard bound of the determinant rather than
an exact zero compare, since the rounding of an exactly-degenerate
triple product depends on association order. The measured relative
volumes are cleanly bimodal (degenerates at <=1e-7, real elements at
>=1e-5), so the 1e-5 cutoff removes only degenerate elements.

* Drop caplog assertion from degenerate-tet test

* style: format code with Black

This commit fixes the style issues introduced in efe750d according to the output
from Black.

Details: #63

* Address review: explicit grid bounds in test, no_grad in _orient_tets

construct_voxel_grid defaults to bounds [-0.05, 1.05] in this repo, so
scaling by 2 did not produce the [-1, 1] domain the test comment
claimed; pass explicit bounds instead. Also wrap the orientation
classification in torch.no_grad() since it only derives integer index
masks.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* add the threshold factor as an argument and merge main (#71)

* fix bounds slicing for xmin and xmax calculations (#64)

* Add homogenization (#65)

* Add test experiment for homogenization model with training artifacts

- Introduced new experiment directory for testing homogenization.
- Added latest model, optimizer parameters, latent codes, and logs as binary files.
- Created specs.json to define network architecture and training parameters.
- Added training summary in training_summary.json.
- Implemented a test function to train the homogenization model in test_train_model.py.

* Add homogenization network and update training loss calculation

* added xlim option back to plot sdf

* Update test experiment specs and data directory for homogenization model

* Refactor homogenization model tests to use shared data directory fixture

* set default dtype to float32 in test train model

* reduced test duration by reducing sampling points

* fix retry 429 error

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix negative Jacobian at mesh resolution 10 by filtering tets in float64

The orientation check ran in float32 but torchfem evaluates Jacobians in
float64 (after verts.to(float64)). Tets with a tiny positive float32
volume can flip negative in float64, causing the "Negative Jacobian"
exception. Compute the final validity mask in float64 so the filter is
consistent with torchfem.

* added HF secret

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>

* Fix wrong module loading (#66)

* Refactor model loading to handle module prefix in state_dict more efficiently

* added some additional output checks for the model export

* replaced deprecated torch.linalg.norm argument axes

* Fix type comparison in optimization (#67)

* Fix type comparison

* Add previous type checks for compatibility reasons

---------

Co-authored-by: Aron Längert <e11916873@student.ilsb.tuwien.ac.at>

* added pypi publish workflow

* Fix publish workflow (#69)

* added pypi environment

* fixed version criteria

* added guard to only trigger on main

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Skip publish job on non-tag pushes in PyPI workflow (#70)

* Initial plan

* chore: start publish failure investigation

Co-authored-by: mkofler96 <18218171+mkofler96@users.noreply.github.com>

* fix(ci): skip publish job on branch pushes

Co-authored-by: mkofler96 <18218171+mkofler96@users.noreply.github.com>

* chore: revert unintended uv lockfile changes

Co-authored-by: mkofler96 <18218171+mkofler96@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: mkofler96 <18218171+mkofler96@users.noreply.github.com>

* add threshold_factor argument

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: Michael Kofler <michael.kofler@tuwien.ac.at>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Aron Längert <e11916873@student.ilsb.tuwien.ac.at>
Co-authored-by: Michael Kofler <rasta.kof@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: mkofler96 <18218171+mkofler96@users.noreply.github.com>

* Revert "add the threshold factor as an argument and merge main (#71)"

This reverts commit 7081e77.

* add threshold_factor argument

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Aron Längert <18172321+ALaengert99@users.noreply.github.com>
Co-authored-by: Aron Längert <e11916873@student.ilsb.tuwien.ac.at>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: mkofler96 <18218171+mkofler96@users.noreply.github.com>
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.

3 participants