Skip to content

Conversation

@jurasic-pf
Copy link
Collaborator

@jurasic-pf jurasic-pf commented Apr 14, 2025

Building a Factory function is complicated by the current situation with move/copy assignment operators.

Revisit once this is resolved.
#164

Copy link
Collaborator Author

jurasic-pf commented Apr 14, 2025


How to use the Graphite Merge Queue

Add the label merge-queue to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@jurasic-pf jurasic-pf force-pushed the jurasic-mgrid-absl-errors branch from 00cbf09 to 5eefaa0 Compare April 14, 2025 08:18
@jurasic-pf jurasic-pf force-pushed the jurasic-vmec-from-indata branch from 9a284bb to cf513ab Compare April 14, 2025 08:18
@jurasic-pf jurasic-pf force-pushed the jurasic-mgrid-absl-errors branch from 5eefaa0 to e582b31 Compare April 14, 2025 08:24
@jurasic-pf jurasic-pf force-pushed the jurasic-vmec-from-indata branch from cf513ab to 84f3707 Compare April 14, 2025 08:24
@jurasic-pf jurasic-pf marked this pull request as ready for review April 14, 2025 08:32
@jurasic-pf jurasic-pf changed the base branch from jurasic-mgrid-absl-errors to graphite-base/244 April 14, 2025 08:34
@jurasic-pf jurasic-pf force-pushed the jurasic-vmec-from-indata branch from 84f3707 to 7cab8ad Compare April 14, 2025 08:34
@jurasic-pf jurasic-pf changed the base branch from graphite-base/244 to jurasic-mgrid-error-handling April 14, 2025 08:35
@graphite-app graphite-app bot changed the base branch from jurasic-mgrid-error-handling to graphite-base/244 April 14, 2025 09:30
@jurasic-pf jurasic-pf force-pushed the jurasic-vmec-from-indata branch from 7cab8ad to 1c1ef4b Compare April 14, 2025 10:18
@jurasic-pf jurasic-pf changed the base branch from graphite-base/244 to main April 14, 2025 10:19
@graphite-app
Copy link

graphite-app bot commented Apr 14, 2025

Merge activity

  • Apr 14, 6:19 AM EDT: Graphite rebased this pull request after merging its parent, because this pull request is set to merge when ready.

@jurasic-pf jurasic-pf marked this pull request as draft April 14, 2025 10:22
@jurasic-pf jurasic-pf self-assigned this Apr 14, 2025
@jurasic-pf jurasic-pf force-pushed the jurasic-vmec-from-indata branch from 1c1ef4b to 410e7f9 Compare April 14, 2025 10:23
graphite-app bot pushed a commit that referenced this pull request Apr 17, 2025
## Issue
The Vmec constructor had absl::CHECK calls in the constructor, which terminated not just the vmecpp execution but also the python wrapper process when mgrid file loading failed, without an Exception or error message that the user could handle.

## Proposed solution
### TLDR
Init method for mgrid loading

### Long version
The PR refactors the `Vmec` constructor to do pure, exception free initialization (Ignoring the possibility of a memory allocation error from std::vector) and moves all sources of exceptions to places where we can report an `absl::Status`. It removes the magnetic response table constructor of Vmec, and all mgrid related initialization is instead handled in `InitMgrid`, a new method that returns the completion status.

**The downside** is, that `Vmec(indata)` does no longer produce a valid object for free-boundary input files. Instead, the mgrid load is finalized during the first call to `run()` if any file IO is required.

**Positive** is that the error handling is now correct for missing, invalid mgrid files, wrong resolutions etc. and returns error codes/Python exceptions instead of terminating.

A long term better API would be: #244
graphite-app bot pushed a commit that referenced this pull request Apr 17, 2025
## Issue
The Vmec constructor had absl::CHECK calls in the constructor, which terminated not just the vmecpp execution but also the python wrapper process when mgrid file loading failed, without an Exception or error message that the user could handle.

## Proposed solution
### TLDR
Init method for mgrid loading

### Long version
The PR refactors the `Vmec` constructor to do pure, exception free initialization (Ignoring the possibility of a memory allocation error from std::vector) and moves all sources of exceptions to places where we can report an `absl::Status`. It removes the magnetic response table constructor of Vmec, and all mgrid related initialization is instead handled in `InitMgrid`, a new method that returns the completion status.

**The downside** is, that `Vmec(indata)` does no longer produce a valid object for free-boundary input files. Instead, the mgrid load is finalized during the first call to `run()` if any file IO is required.

**Positive** is that the error handling is now correct for missing, invalid mgrid files, wrong resolutions etc. and returns error codes/Python exceptions instead of terminating.

A long term better API would be: #244
@jurasic-pf jurasic-pf changed the base branch from main to graphite-base/244 April 22, 2025 10:13
@jurasic-pf jurasic-pf force-pushed the jurasic-vmec-from-indata branch from 410e7f9 to 1e2a5df Compare April 22, 2025 10:13
@jurasic-pf jurasic-pf changed the base branch from graphite-base/244 to jurasic/eigen-bazel-version April 22, 2025 10:13
@jurasic-pf jurasic-pf changed the base branch from jurasic/eigen-bazel-version to graphite-base/244 April 22, 2025 10:15
@jurasic-pf jurasic-pf force-pushed the jurasic-vmec-from-indata branch from 1e2a5df to 610173e Compare April 22, 2025 10:15
@jurasic-pf jurasic-pf changed the base branch from graphite-base/244 to main April 22, 2025 10:15
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.

2 participants