From aa0ea92c996c7ec1b0db527b56f58f2111fd0402 Mon Sep 17 00:00:00 2001 From: Wim Haeck Date: Wed, 24 Apr 2024 11:07:57 -0600 Subject: [PATCH 1/2] Removing a few interface functions that are unused --- src/ENDFtk/TabulationRecord.hpp | 37 ------------- .../test/TabulationRecord.test.cpp | 52 ------------------- src/ENDFtk/section/1/455.hpp | 1 + src/ENDFtk/section/1/458.hpp | 2 + src/ENDFtk/section/10/ReactionProduct.hpp | 1 - src/ENDFtk/section/12.hpp | 1 + src/ENDFtk/section/12/PartialMultiplicity.hpp | 1 - src/ENDFtk/section/14.hpp | 1 + src/ENDFtk/section/2/151.hpp | 2 + src/ENDFtk/section/26.hpp | 2 + src/ENDFtk/section/4.hpp | 1 + src/ENDFtk/section/7/4.hpp | 4 +- src/ENDFtk/section/8/457.hpp | 3 +- src/ENDFtk/section/9/ReactionProduct.hpp | 1 - 14 files changed, 15 insertions(+), 94 deletions(-) diff --git a/src/ENDFtk/TabulationRecord.hpp b/src/ENDFtk/TabulationRecord.hpp index 91a2da47..42108b41 100644 --- a/src/ENDFtk/TabulationRecord.hpp +++ b/src/ENDFtk/TabulationRecord.hpp @@ -7,10 +7,6 @@ // other includes #include "tools/Log.hpp" #include "range/v3/view/all.hpp" -#include "range/v3/view/iota.hpp" -#include "range/v3/view/subrange.hpp" -#include "range/v3/view/transform.hpp" -#include "range/v3/view/zip.hpp" #include "ENDFtk/record.hpp" namespace njoy { @@ -38,20 +34,6 @@ namespace ENDFtk { #include "ENDFtk/TabulationRecord/src/verifyNP.hpp" #include "ENDFtk/TabulationRecord/src/readPairs.hpp" - protected: - - auto regions( size_t index ) const { - const auto left = index ? this->boundaries()[ index - 1 ] - 1 : 0; - const auto right = this->boundaries()[ index ]; - return - std::make_pair( ranges::make_subrange - ( this->xValues.begin() + left, - this->xValues.begin() + right ), - ranges::make_subrange - ( this->yValues.begin() + left, - this->yValues.begin() + right ) ); - } - public: /* constructor */ @@ -92,30 +74,11 @@ namespace ENDFtk { return ranges::cpp20::views::all( this->yValues ); } - /** - * @brief Return the x,y pairs in the table - */ - auto pairs() const { - - return ranges::views::zip( this->xValues, this->yValues ); - } - using InterpolationBase::INT; using InterpolationBase::NBT; using InterpolationBase::interpolants; using InterpolationBase::boundaries; - /** - * @brief Return the interpolation regions - */ - auto regions() const { - - return - ranges::views::iota( 0ul, this->boundaries().size() ) - | ranges::cpp20::views::transform( - [this ]( int i ){ return this->regions(i); } ); - } - /** * @brief Equality operator * diff --git a/src/ENDFtk/TabulationRecord/test/TabulationRecord.test.cpp b/src/ENDFtk/TabulationRecord/test/TabulationRecord.test.cpp index 8607d88b..340c357f 100644 --- a/src/ENDFtk/TabulationRecord/test/TabulationRecord.test.cpp +++ b/src/ENDFtk/TabulationRecord/test/TabulationRecord.test.cpp @@ -390,58 +390,6 @@ void verifyChunk( const TabulationRecord& chunk ) { CHECK_THAT( 9., WithinRel( chunk.y()[6] ) ); CHECK_THAT( 10., WithinRel( chunk.y()[7] ) ); - auto regions = chunk.regions(); - CHECK( 4 == regions.size() ); - CHECK( 4 == regions[0].first.size() ); - CHECK( 4 == regions[0].second.size() ); - CHECK( 2 == regions[1].first.size() ); - CHECK( 2 == regions[1].second.size() ); - CHECK( 2 == regions[2].first.size() ); - CHECK( 2 == regions[2].second.size() ); - CHECK( 3 == regions[3].first.size() ); - CHECK( 3 == regions[3].second.size() ); - CHECK_THAT( 1., WithinRel( regions[0].first[0] ) ); - CHECK_THAT( 2., WithinRel( regions[0].first[1] ) ); - CHECK_THAT( 3., WithinRel( regions[0].first[2] ) ); - CHECK_THAT( 4., WithinRel( regions[0].first[3] ) ); - CHECK_THAT( 4., WithinRel( regions[1].first[0] ) ); - CHECK_THAT( 5., WithinRel( regions[1].first[1] ) ); - CHECK_THAT( 5., WithinRel( regions[2].first[0] ) ); - CHECK_THAT( 6., WithinRel( regions[2].first[1] ) ); - CHECK_THAT( 6., WithinRel( regions[3].first[0] ) ); - CHECK_THAT( 7., WithinRel( regions[3].first[1] ) ); - CHECK_THAT( 8., WithinRel( regions[3].first[2] ) ); - CHECK_THAT( 3., WithinRel( regions[0].second[0] ) ); - CHECK_THAT( 4., WithinRel( regions[0].second[1] ) ); - CHECK_THAT( 5., WithinRel( regions[0].second[2] ) ); - CHECK_THAT( 6., WithinRel( regions[0].second[3] ) ); - CHECK_THAT( 6., WithinRel( regions[1].second[0] ) ); - CHECK_THAT( 7., WithinRel( regions[1].second[1] ) ); - CHECK_THAT( 7., WithinRel( regions[2].second[0] ) ); - CHECK_THAT( 8., WithinRel( regions[2].second[1] ) ); - CHECK_THAT( 8., WithinRel( regions[3].second[0] ) ); - CHECK_THAT( 9., WithinRel( regions[3].second[1] ) ); - CHECK_THAT( 10., WithinRel( regions[3].second[2] ) ); - - auto pairs = chunk.pairs(); - CHECK( 8 == pairs.size() ); - CHECK_THAT( 1., WithinRel( pairs[0].first ) ); - CHECK_THAT( 2., WithinRel( pairs[1].first ) ); - CHECK_THAT( 3., WithinRel( pairs[2].first ) ); - CHECK_THAT( 4., WithinRel( pairs[3].first ) ); - CHECK_THAT( 5., WithinRel( pairs[4].first ) ); - CHECK_THAT( 6., WithinRel( pairs[5].first ) ); - CHECK_THAT( 7., WithinRel( pairs[6].first ) ); - CHECK_THAT( 8., WithinRel( pairs[7].first ) ); - CHECK_THAT( 3., WithinRel( pairs[0].second ) ); - CHECK_THAT( 4., WithinRel( pairs[1].second ) ); - CHECK_THAT( 5., WithinRel( pairs[2].second ) ); - CHECK_THAT( 6., WithinRel( pairs[3].second ) ); - CHECK_THAT( 7., WithinRel( pairs[4].second ) ); - CHECK_THAT( 8., WithinRel( pairs[5].second ) ); - CHECK_THAT( 9., WithinRel( pairs[6].second ) ); - CHECK_THAT( 10., WithinRel( pairs[7].second ) ); - CHECK( 6 == chunk.NC() ); } diff --git a/src/ENDFtk/section/1/455.hpp b/src/ENDFtk/section/1/455.hpp index 69fd5678..f5fbd5fd 100644 --- a/src/ENDFtk/section/1/455.hpp +++ b/src/ENDFtk/section/1/455.hpp @@ -14,6 +14,7 @@ #include "ENDFtk/section.hpp" #include "range/v3/view/stride.hpp" #include "range/v3/view/drop_exactly.hpp" +#include "range/v3/view/transform.hpp" #include "ENDFtk/section/1/PolynomialMultiplicity.hpp" #include "ENDFtk/section/1/TabulatedMultiplicity.hpp" diff --git a/src/ENDFtk/section/1/458.hpp b/src/ENDFtk/section/1/458.hpp index 54f6797f..d950345d 100644 --- a/src/ENDFtk/section/1/458.hpp +++ b/src/ENDFtk/section/1/458.hpp @@ -12,6 +12,8 @@ #include "ENDFtk/ListRecord.hpp" #include "ENDFtk/TabulationRecord.hpp" #include "ENDFtk/section.hpp" +#include "range/v3/view/iota.hpp" +#include "range/v3/view/transform.hpp" #include "range/v3/view/chunk.hpp" #include "range/v3/view/drop_exactly.hpp" #include "range/v3/view/stride.hpp" diff --git a/src/ENDFtk/section/10/ReactionProduct.hpp b/src/ENDFtk/section/10/ReactionProduct.hpp index df8eaf55..3c89c146 100644 --- a/src/ENDFtk/section/10/ReactionProduct.hpp +++ b/src/ENDFtk/section/10/ReactionProduct.hpp @@ -85,7 +85,6 @@ class ENDFTK_PYTHON_EXPORT ReactionProduct : protected TabulationRecord { using TabulationRecord::boundaries; using TabulationRecord::x; using TabulationRecord::y; - using TabulationRecord::regions; using TabulationRecord::NC; using TabulationRecord::print; }; diff --git a/src/ENDFtk/section/12.hpp b/src/ENDFtk/section/12.hpp index b0500174..56d7e63f 100644 --- a/src/ENDFtk/section/12.hpp +++ b/src/ENDFtk/section/12.hpp @@ -8,6 +8,7 @@ // other includes #include "range/v3/view/chunk.hpp" #include "range/v3/view/join.hpp" +#include "range/v3/view/transform.hpp" #include "ENDFtk/macros.hpp" #include "ENDFtk/ControlRecord.hpp" #include "ENDFtk/ListRecord.hpp" diff --git a/src/ENDFtk/section/12/PartialMultiplicity.hpp b/src/ENDFtk/section/12/PartialMultiplicity.hpp index 22ee6446..c0764667 100644 --- a/src/ENDFtk/section/12/PartialMultiplicity.hpp +++ b/src/ENDFtk/section/12/PartialMultiplicity.hpp @@ -85,7 +85,6 @@ class ENDFTK_PYTHON_EXPORT PartialMultiplicity : protected TabulationRecord { using TabulationRecord::boundaries; using TabulationRecord::x; using TabulationRecord::y; - using TabulationRecord::regions; using TabulationRecord::NC; using TabulationRecord::print; }; diff --git a/src/ENDFtk/section/14.hpp b/src/ENDFtk/section/14.hpp index 546528c5..6b6b5bed 100644 --- a/src/ENDFtk/section/14.hpp +++ b/src/ENDFtk/section/14.hpp @@ -6,6 +6,7 @@ // other includes #include "range/v3/algorithm/count_if.hpp" +#include "range/v3/view/transform.hpp" #include "ENDFtk/macros.hpp" #include "ENDFtk/ControlRecord.hpp" #include "ENDFtk/ListRecord.hpp" diff --git a/src/ENDFtk/section/2/151.hpp b/src/ENDFtk/section/2/151.hpp index 731a306b..dad3b5d7 100644 --- a/src/ENDFtk/section/2/151.hpp +++ b/src/ENDFtk/section/2/151.hpp @@ -11,6 +11,8 @@ #include "range/v3/algorithm/find.hpp" #include "range/v3/range/conversion.hpp" #include "range/v3/view/all.hpp" +#include "range/v3/view/iota.hpp" +#include "range/v3/view/transform.hpp" #include "range/v3/view/chunk.hpp" #include "range/v3/view/drop_exactly.hpp" #include "range/v3/view/repeat_n.hpp" diff --git a/src/ENDFtk/section/26.hpp b/src/ENDFtk/section/26.hpp index 297e5d6d..61cf4393 100644 --- a/src/ENDFtk/section/26.hpp +++ b/src/ENDFtk/section/26.hpp @@ -14,6 +14,8 @@ #include "range/v3/view/single.hpp" #include "range/v3/view/stride.hpp" #include "range/v3/view/tail.hpp" +#include "range/v3/view/zip.hpp" +#include "range/v3/view/transform.hpp" #include "ENDFtk/macros.hpp" #include "ENDFtk/ControlRecord.hpp" #include "ENDFtk/ListRecord.hpp" diff --git a/src/ENDFtk/section/4.hpp b/src/ENDFtk/section/4.hpp index b7fc54f7..ccefe713 100644 --- a/src/ENDFtk/section/4.hpp +++ b/src/ENDFtk/section/4.hpp @@ -10,6 +10,7 @@ #include "range/v3/view/transform.hpp" #include "range/v3/view/empty.hpp" #include "range/v3/view/any_view.hpp" +#include "range/v3/view/transform.hpp" #include "ENDFtk/macros.hpp" #include "ENDFtk/ControlRecord.hpp" #include "ENDFtk/ListRecord.hpp" diff --git a/src/ENDFtk/section/7/4.hpp b/src/ENDFtk/section/7/4.hpp index cfd901fb..2c4f6a1a 100644 --- a/src/ENDFtk/section/7/4.hpp +++ b/src/ENDFtk/section/7/4.hpp @@ -15,6 +15,8 @@ #include "range/v3/view/single.hpp" #include "range/v3/view/stride.hpp" #include "range/v3/view/transform.hpp" +#include "range/v3/view/transform.hpp" +#include "range/v3/view/zip.hpp" #include "ENDFtk/macros.hpp" #include "ENDFtk/ControlRecord.hpp" #include "ENDFtk/ListRecord.hpp" @@ -27,7 +29,7 @@ namespace ENDFtk { namespace section{ template<> - class ENDFTK_PYTHON_EXPORT Type< 7, 4 > : + class ENDFTK_PYTHON_EXPORT Type< 7, 4 > : protected BaseWithoutMT< Type< 7, 4 > > { friend BaseWithoutMT< Type< 7, 4 > >; diff --git a/src/ENDFtk/section/8/457.hpp b/src/ENDFtk/section/8/457.hpp index e1823d63..3e7e27f2 100644 --- a/src/ENDFtk/section/8/457.hpp +++ b/src/ENDFtk/section/8/457.hpp @@ -9,6 +9,7 @@ #include "range/v3/range/conversion.hpp" #include "range/v3/view/chunk.hpp" #include "range/v3/view/join.hpp" +#include "range/v3/view/transform.hpp" #include "ENDFtk/macros.hpp" #include "ENDFtk/ControlRecord.hpp" #include "ENDFtk/ListRecord.hpp" @@ -21,7 +22,7 @@ namespace ENDFtk { namespace section{ template<> - class ENDFTK_PYTHON_EXPORT Type< 8, 457 > : + class ENDFTK_PYTHON_EXPORT Type< 8, 457 > : protected BaseWithoutMT< Type< 8, 457 > > { friend BaseWithoutMT< Type< 8, 457 > >; diff --git a/src/ENDFtk/section/9/ReactionProduct.hpp b/src/ENDFtk/section/9/ReactionProduct.hpp index 17b859ad..c24d5f22 100644 --- a/src/ENDFtk/section/9/ReactionProduct.hpp +++ b/src/ENDFtk/section/9/ReactionProduct.hpp @@ -85,7 +85,6 @@ class ENDFTK_PYTHON_EXPORT ReactionProduct : protected TabulationRecord { using TabulationRecord::boundaries; using TabulationRecord::x; using TabulationRecord::y; - using TabulationRecord::regions; using TabulationRecord::NC; using TabulationRecord::print; }; From 7bbf007fcb43158f8a867778443d36a3e6311ccf Mon Sep 17 00:00:00 2001 From: Wim Haeck Date: Wed, 24 Apr 2024 11:17:06 -0600 Subject: [PATCH 2/2] Setting version and updating release notes --- CMakeLists.txt | 2 +- ReleaseNotes.md | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 50fb2d31..4b84ae0f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,7 @@ if( DEFINED PROJECT_NAME ) endif() project( ENDFtk - VERSION 1.1.0 + VERSION 1.1.1 LANGUAGES CXX ) diff --git a/ReleaseNotes.md b/ReleaseNotes.md index 60691e5d..6051fb33 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -1,6 +1,12 @@ # Release Notes—ENDFtk Given here are some release notes for ENDFtk. +## [ENDFtk v1.1.1](https://github.com/njoy/ENDFtk/pull/xxx) +This update removes a few interface functions that are unused: + - the regions() and pairs() interface functions on the TAB1 record + +The removal of these interface functions has no impact on the Python interface as these interface functions were not included on the Python side. + ## [ENDFtk v1.1.0](https://github.com/njoy/ENDFtk/pull/198) This update adds additional interface functions to complete the human readable and ENDF speak interface for many objects: - the NBT() and INT() interface functions to complement the boundaries() and interpolants() functions already present in TAB1 and TAB2 style components