Skip to content

Add input validation for bias parameter in cylindrical basis#202

Merged
The9Cat merged 4 commits intoSphericalExactfrom
copilot/sub-pr-199-again
Feb 4, 2026
Merged

Add input validation for bias parameter in cylindrical basis#202
The9Cat merged 4 commits intoSphericalExactfrom
copilot/sub-pr-199-again

Conversation

Copy link

Copilot AI commented Feb 4, 2026

The bias parameter in cylindrical basis configuration is parsed from YAML and multiplied into acyl during EmpCylSL construction, but lacked input validation. Invalid values (negative, zero, NaN, infinite) would propagate through to basis construction, causing unclear failures.

Changes

  • Added validation after YAML parsing in BiorthBasis.cc to require bias > 0 and finite
  • Validation placed in existing parameter enforcement section (lines 1561-1570) for consistency
  • Error messages indicate the constraint violated and the invalid value received
// Validate bias parameter
//
if (!std::isfinite(bias)) {
  throw std::runtime_error("Cylindrical: 'bias' parameter must be finite");
}
if (bias <= 0.0) {
  std::ostringstream sout;
  sout << "Cylindrical: 'bias' parameter must be positive, got " << bias;
  throw std::runtime_error(sout.str());
}

Invalid configs now fail immediately with clear diagnostics rather than producing broken basis instances.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits February 4, 2026 15:13
Co-authored-by: The9Cat <25960766+The9Cat@users.noreply.github.com>
Co-authored-by: The9Cat <25960766+The9Cat@users.noreply.github.com>
Co-authored-by: The9Cat <25960766+The9Cat@users.noreply.github.com>
Copy link
Author

Copilot AI commented Feb 4, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • esm.ubuntu.com
    • Triggering command: /usr/lib/apt/methods/https /usr/lib/apt/methods/https (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Address feedback on spherical basis deprojection Add input validation for bias parameter in cylindrical basis Feb 4, 2026
Copilot AI requested a review from The9Cat February 4, 2026 15:23
@The9Cat The9Cat marked this pull request as ready for review February 4, 2026 15:31
@The9Cat The9Cat merged commit 490b46c into SphericalExact Feb 4, 2026
@The9Cat The9Cat deleted the copilot/sub-pr-199-again branch February 4, 2026 15:32
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