Skip to content

Commit

Permalink
Merge pull request #201 from njoy/fix/rectangularmatrix
Browse files Browse the repository at this point in the history
Fix/rectangularmatrix
  • Loading branch information
whaeck authored Jun 12, 2024
2 parents 374c991 + a28bd91 commit 5db9fdc
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
# ENDFtk
Toolkit for reading and interacting with ENDF-6 formatted files. This toolkit provides a full C++ library along with python bindings.

## Citation

To cite ENDFtk, please use the following publication:

W. Haeck, N. Gibson, P. Talou, “ENDFtk: A robust tool for reading and writing ENDF-formatted nuclear data,” Comp. Phys. Comm., 303 (2024),
DOI: [10.1016/j.cpc.2024.109245](https://doi.org/10.1016/j.cpc.2024.109245)

## Release and development versions
For the latest version of ENDFtk and an overview of the latest changes, please see the [Release Notes](ReleaseNotes.md) or the [release](https://github.com/njoy/ENDFtk/releases) page.

Expand Down
7 changes: 4 additions & 3 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
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
This update removes the regions() and pairs() interface functions on the TAB1 record interface functions that are unused. The removal of these interface functions has no impact on the Python interface as these interface functions were not included on the Python side.

The removal of these interface functions has no impact on the Python interface as these interface functions were not included on the Python side.
In addition, a minor bug in the rectangular matrix covariance block was corrected. The values for the row and column energies are lifted out of a larger array using the std::ranges::take and std::ranges::drop function. For the column energies, we forgot to properly end the sequence. As a result, the end() iterator of the range did not point to the end of the column energies but to the end of the covariance values. This has been corrected.

A few changes were also made to remove some range-v3 code in MF1 MT451. These changes have no impact on functionality.

## [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:
Expand Down
2 changes: 2 additions & 0 deletions python/test/Test_ENDFtk_RectangularMatrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ def verify_chunk( self, chunk ) :
self.assertEqual( 6, chunk.procedure )
self.assertEqual( 3, chunk.NER )
self.assertEqual( 3, chunk.number_row_energies )
self.assertEqual( 3, len( chunk.row_energies ) )
self.assertEqual( 4, chunk.NEC )
self.assertEqual( 4, chunk.number_column_energies )
self.assertEqual( 4, len( chunk.column_energies ) )
self.assertEqual( 13, chunk.NT )
self.assertEqual( 13, chunk.number_values )

Expand Down
3 changes: 2 additions & 1 deletion src/ENDFtk/section/RectangularMatrix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ class ENDFTK_PYTHON_EXPORT RectangularMatrix : protected ListRecord {
*/
auto columnEnergies() const {

return ranges::views::drop_exactly( ListRecord::list(), this->NER() );
return ranges::views::take_exactly( ListRecord::list(), this->NER() + this->NEC() )
| ranges::views::drop_exactly( this->NER() );
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,10 @@ void verifyChunk( const RectangularMatrix& chunk ) {
CHECK( 6 == chunk.procedure() );
CHECK( 3 == chunk.NER() );
CHECK( 3 == chunk.numberRowEnergies() );
CHECK( 3 == chunk.rowEnergies().size() );
CHECK( 4 == chunk.NEC() );
CHECK( 4 == chunk.numberColumnEnergies() );
CHECK( 4 == chunk.columnEnergies().size() );
CHECK( 13 == chunk.NT() );
CHECK( 13 == chunk.numberValues() );

Expand Down

0 comments on commit 5db9fdc

Please sign in to comment.