Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect application of EPS (Papercut/ issue #1084) #3000

Merged
merged 10 commits into from
Feb 16, 2024
Merged

Conversation

OceanNuclear
Copy link
Contributor

Linked Issues

Closes #1084

Description

Since floating point numbers isn't a dense representation of the real number line (it's sparse, but "denser" toward the center:
image
)
We have to consider that the "resolution" varies with the value of the float, i.e. the step size increases wrt. abs value of float.

Interface Changes

Added a variable called "EPS_FREECAD" which would be used in place of EPS whenever geometry is involved.

Checklist

I confirm that I have completed the following checks:

  • Tests run locally and pass pytest tests --reactor
  • Code quality checks run locally and pass pre-commit run --from-ref develop --to-ref HEAD
  • Documentation built locally and checked sphinx-build -W documentation/source documentation/build

@OceanNuclear OceanNuclear requested review from a team as code owners February 7, 2024 17:04
@OceanNuclear OceanNuclear changed the base branch from develop to papercut/1610 February 7, 2024 17:05
@je-cook je-cook added this to the Version 1.9.0 milestone Feb 8, 2024
Copy link
Contributor

github-actions bot commented Feb 9, 2024

⚠️ Warning Report

Found 0 new warnings, 0 fixed warnings. 🎉

All warnings (15)

On collect

  • /home/runner/miniconda3/envs/bluemira/lib/python3.8/site-packages/shiboken2/files.dir/shibokensupport/feature.py:139: DeprecationWarning: The module 'bluemira.geometry.optimisation._optimisation_old' is deprecated and will be removed in v2.0.0. See https://bluemira.readthedocs.io/en/latest/optimisation/optimisation.html for documentation of the new optimisation module.
  • /home/runner/miniconda3/envs/bluemira/lib/python3.8/site-packages/pkg_resources/__init__.py:2868: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace('mpl_toolkits'). Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
  • /home/runner/miniconda3/envs/bluemira/lib/python3.8/site-packages/shiboken2/files.dir/shibokensupport/feature.py:139: DeprecationWarning: The module 'bluemira.equilibria.opt_problems' is deprecated and will be removed in v2.0.0. See https://bluemira.readthedocs.io/en/latest/optimisation/optimisation.html for documentation of the new optimisation module.
  • /home/runner/miniconda3/envs/bluemira/lib/python3.8/site-packages/shiboken2/files.dir/shibokensupport/feature.py:139: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  • /home/runner/miniconda3/envs/bluemira/lib/python3.8/site-packages/pkg_resources/__init__.py:2868: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace('sphinxcontrib'). Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
  • /home/runner/miniconda3/envs/bluemira/lib/python3.8/site-packages/shiboken2/files.dir/shibokensupport/feature.py:139: DeprecationWarning: The module 'bluemira.utilities.opt_problems' is deprecated and will be removed in v2.0.0. See https://bluemira.readthedocs.io/en/latest/optimisation/optimisation.html for documentation of the new optimisation module.
  • /home/runner/miniconda3/envs/bluemira/lib/python3.8/site-packages/shiboken2/files.dir/shibokensupport/feature.py:139: DeprecationWarning: The module 'bluemira.equilibria.opt_objectives' is deprecated and will be removed in v2.0.0. See https://bluemira.readthedocs.io/en/latest/optimisation/optimisation.html for documentation of the new optimisation module.
  • /home/runner/miniconda3/envs/bluemira/lib/python3.8/site-packages/shiboken2/files.dir/shibokensupport/feature.py:139: DeprecationWarning: The module 'bluemira.utilities.opt_tools' is deprecated and will be removed in v2.0.0. See https://bluemira.readthedocs.io/en/latest/optimisation/optimisation.html for documentation of the new optimisation module.
  • /home/runner/miniconda3/envs/bluemira/lib/python3.8/site-packages/shiboken2/files.dir/shibokensupport/feature.py:139: DeprecationWarning: The module 'bluemira.utilities.optimiser' is deprecated and will be removed in version 2.0.0. See https://bluemira.readthedocs.io/en/latest/optimisation/optimisation.html for documentation of the new optimisation module.
  • /home/runner/miniconda3/envs/bluemira/lib/python3.8/site-packages/shiboken2/files.dir/shibokensupport/feature.py:139: DeprecationWarning: The module 'bluemira.equilibria.opt_constraint_funcs' is deprecated and will be removed in v2.0.0. See https://bluemira.readthedocs.io/en/latest/optimisation/optimisation.html for documentation of the new optimisation module.
  • /home/runner/miniconda3/envs/bluemira/lib/python3.8/site-packages/shiboken2/files.dir/shibokensupport/feature.py:139: DeprecationWarning: The module 'bluemira.equilibria.opt_constraints' is deprecated and will be removed in v2.0.0. See https://bluemira.readthedocs.io/en/latest/optimisation/optimisation.html for documentation of the new optimisation module.

On runtest

  • /home/runner/work/bluemira/bluemira/bluemira/base/reactor.py:677: DeprecationWarning: Using kwarg 'dim' is no longer supported. Simply pass in the dimensions you would like to show, e.g. show_cad('xz')
  • /home/runner/work/bluemira/bluemira/eudemo/eudemo/tf_coils/tf_coils.py:338: DeprecationWarning: Argument 'separatrix' is deprecated, argument 'ripple_wire' is used instead.
  • /home/runner/work/bluemira/bluemira/tests/builders/test_tf_coils.py:46: DeprecationWarning: RippleConstrainedLengthGOP API has changed, please specify how you want to constrain TF ripple by using one of the available RipplePointSelector classes. Defaulting to an EquispacedSelector with n_rip_points=3 for now.
  • /home/runner/miniconda3/envs/bluemira/lib/python3.8/site-packages/h5py/__init__.py:36: UserWarning: h5py is running against HDF5 1.14.3 when it was built against 1.14.2, this may cause problems

Base automatically changed from papercut/1610 to develop February 9, 2024 15:37
@je-cook je-cook removed the request for review from a team February 12, 2024 13:04
Copy link

codecov bot commented Feb 12, 2024

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (0966511) 79.79% compared to head (832551a) 79.79%.
Report is 5 commits behind head on develop.

Files Patch % Lines
bluemira/magnetostatics/polyhedral_prism.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3000   +/-   ##
========================================
  Coverage    79.79%   79.79%           
========================================
  Files          226      226           
  Lines        25120    25122    +2     
========================================
+ Hits         20045    20047    +2     
  Misses        5075     5075           

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

@je-cook je-cook self-assigned this Feb 15, 2024
Copy link

sonarcloud bot commented Feb 15, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@je-cook je-cook merged commit d8b8961 into develop Feb 16, 2024
4 checks passed
@je-cook je-cook deleted the papercut/1084 branch February 16, 2024 09:17
OceanNuclear added a commit that referenced this pull request Feb 20, 2024
* Fixed all of the places where EPS may be incorrectly applied

* Fixed all places where EPS is used in atol instead of rtol incorrectly.

* Moved the EPS_FREECAD constant to geometry.constants; Identified and fixed the bug that caused the Interpolator's geometry to be considered infeasible (accidentally set the threshold too tight when the atol=0 overrode the default tolerance.).

* Increased test coverage

* Removed optimize.bisect and found an analytical solution using arctan instead.

* ruff check

* Corrected tolerance value to D_TOLERANCE, and added test coverage.

* deleted debugging print statement

* Minor edit to comments in geometry.constants

* Finished papercut.
OceanNuclear added a commit that referenced this pull request Jun 17, 2024
* Fixed all of the places where EPS may be incorrectly applied

* Fixed all places where EPS is used in atol instead of rtol incorrectly.

* Moved the EPS_FREECAD constant to geometry.constants; Identified and fixed the bug that caused the Interpolator's geometry to be considered infeasible (accidentally set the threshold too tight when the atol=0 overrode the default tolerance.).

* Increased test coverage

* Removed optimize.bisect and found an analytical solution using arctan instead.

* ruff check

* Corrected tolerance value to D_TOLERANCE, and added test coverage.

* deleted debugging print statement

* Minor edit to comments in geometry.constants

* Finished papercut.
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.

Add a GEOMETRY_TOLERANCE or similar and use for treatment of geometry
2 participants