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

Implement per-instance error handling #27

Merged
merged 31 commits into from
Jun 12, 2023
Merged

Conversation

tanaya-mankad
Copy link
Contributor

@tanaya-mankad tanaya-mankad commented Jan 23, 2023

Fix Issue #12 .
Adjust function return values and signatures as required to implement a class-level callback. If none is provided, fall back to global (namespace-level) callback.
Implement module-internal exceptions for fatal errors; do not allow exceptions to propagate out of btwxt.

@@ -2,6 +2,6 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
if (UNIX)
add_definitions("-fPIC")
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

c++11 flag was causing gcc / ubuntu-latest to not compile c++17

src/btwxt.cpp Outdated
RegularGridInterpolator::RegularGridInterpolator(GriddedData &grid_data_in)
: grid_data(grid_data_in), grid_point(grid_data) {}
RegularGridInterpolator::RegularGridInterpolator(const std::vector<std::vector<double>> &grid)
: grid_data(grid), grid_point(grid_data) {}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

GriddedData and GridPoint classes are now relegated to be convenience objects only, and wholly compose RGI. 1. This makes the RGI interface much more similar to scipy.RegularGridInterpolator, and 2. Only one class, RGI, is exposed outside the library.

@codecov-commenter
Copy link

codecov-commenter commented Feb 6, 2023

Codecov Report

Merging #27 (fbfa886) into main (7fe17b5) will increase coverage by 1.04%.
The diff coverage is 73.76%.

❗ Current head fbfa886 differs from pull request most recent head ca51659. Consider uploading reports for the commit ca51659 to get more accurate results

@@            Coverage Diff             @@
##             main      #27      +/-   ##
==========================================
+ Coverage   86.09%   87.13%   +1.04%     
==========================================
  Files           7        6       -1     
  Lines         453      474      +21     
==========================================
+ Hits          390      413      +23     
+ Misses         63       61       -2     
Impacted Files Coverage Δ
src/btwxt.h 0.00% <0.00%> (ø)
src/error.h 71.43% <0.00%> (+71.43%) ⬆️
src/btwxt.cpp 62.96% <61.11%> (-7.04%) ⬇️
src/gridpoint.cpp 92.65% <79.07%> (+1.92%) ⬆️
src/griddeddata.cpp 92.46% <81.03%> (-2.48%) ⬇️
src/gridpoint.h 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Contributor Author

@tanaya-mankad tanaya-mankad left a comment

Choose a reason for hiding this comment

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

A few explanatory comments above.

@nealkruis nealkruis merged commit ca51659 into main Jun 12, 2023
@nealkruis nealkruis deleted the per-instance-error-handling branch September 8, 2023 16:45
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