Skip to content

Commit

Permalink
Merge pull request #20 from njoy/fix/review-part6
Browse files Browse the repository at this point in the history
Changes following review.
  • Loading branch information
whaeck authored Oct 8, 2024
2 parents 428e519 + ed43167 commit 62c0d5a
Show file tree
Hide file tree
Showing 37 changed files with 70 additions and 41 deletions.
2 changes: 1 addition & 1 deletion python/src/depletion.python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ void wrapDepletion( python::module& module, python::module& viewmodule ) {
python::module submodule = module.def_submodule(

"depletion",
"Depeltion NDI records and subrecords"
"Depletion NDI records and subrecords"
);

depletion::wrapReactionMultiplicityType( submodule, viewmodule );
Expand Down
3 changes: 2 additions & 1 deletion python/src/multigroup/FissionNeutronMultiplicity.python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ void wrapFissionNeutronMultiplicity( python::module& module, python::module& ) {
"Initialise the record\n\n"
"Arguments:\n"
" self the record\n"
" type the fission type (prompt, delayed or total)\n"
" values the fission neutron multiplicity values"
)
.def_property_readonly(
Expand All @@ -63,7 +64,7 @@ void wrapFissionNeutronMultiplicity( python::module& module, python::module& ) {
"record\n\n"
"Arguments:\n"
" string the string representing the record\n"
" number the fission neutron multiplicity values"
" number the number of groups"
);

// add standard record definitions
Expand Down
3 changes: 2 additions & 1 deletion python/src/multigroup/FissionNeutronProduction.python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ void wrapFissionNeutronProduction( python::module& module, python::module& ) {
"Initialise the record\n\n"
"Arguments:\n"
" self the record\n"
" type the fission type (prompt, delayed or total)\n"
" values the fission neutron production values"
)
.def_property_readonly(
Expand All @@ -63,7 +64,7 @@ void wrapFissionNeutronProduction( python::module& module, python::module& ) {
"record\n\n"
"Arguments:\n"
" string the string representing the record\n"
" number the fission neutron production values"
" number the number of groups"
);

// add standard record definitions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ void wrapFissionNeutronSpectrumMatrix( python::module& module, python::module& )
"Initialise the record\n\n"
"Arguments:\n"
" self the record\n"
" type the fission type (prompt, delayed or total)\n"
" values the fission neutron spectrum matrix values"
)
.def_property_readonly(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ void wrapFissionNeutronSpectrumVector( python::module& module, python::module& )
"Initialise the record\n\n"
"Arguments:\n"
" self the record\n"
" type the fission type (prompt, delayed or total)\n"
" values the fission neutron spectrum vector values"
)
.def_property_readonly(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ def verify_chunk_typed( self, chunk ) :

# verify the record
self.assertEqual( 'rprod_all', chunk.keyword )
self.assertEqual( ReactionMultiplicityType.All, chunk.type )
self.assertEqual( False, chunk.empty )
self.assertEqual( 12, chunk.size )

Expand Down
16 changes: 8 additions & 8 deletions src/NDItk/MultigroupTable/src/verify.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,15 @@ void verify() {
// secondary particles
if ( this->metadata().numberOutgoingParticles().has_value() ) {

const auto types = this->metadata().numberOutgoingParticles().value();
if ( types > 0 ) {
const auto number = this->metadata().numberOutgoingParticles().value();
if ( number > 0 ) {

if ( ( this->outgoingParticleTypes().numberOutgoingParticles() != types ) ||
( ! this->outgoingParticleTransportData().empty() && this->outgoingParticleTransportData().numberOutgoingParticles() != types ) ||
( this->outgoing_structure_.size() && this->outgoing_structure_.size() != types ) ||
( this->outgoing_production_.size() && this->outgoing_production_.size() != types ) ||
( this->outgoing_heating_.size() && this->outgoing_heating_.size() != types ) ||
( this->outgoing_kerma_.size() && this->outgoing_kerma_.size() != types ) ) {
if ( ( this->outgoingParticleTypes().numberOutgoingParticles() != number ) ||
( ! this->outgoingParticleTransportData().empty() && this->outgoingParticleTransportData().numberOutgoingParticles() != number ) ||
( this->outgoing_structure_.size() && this->outgoing_structure_.size() != number ) ||
( this->outgoing_production_.size() && this->outgoing_production_.size() != number ) ||
( this->outgoing_heating_.size() && this->outgoing_heating_.size() != number ) ||
( this->outgoing_kerma_.size() && this->outgoing_kerma_.size() != number ) ) {

Log::error( "Found inconsistent number of outgoing particle types across the table" );
Log::info( "Number of outgoing particles in the metadata: {}",
Expand Down
2 changes: 1 addition & 1 deletion src/NDItk/depletion/Multiplicities/src/verify.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @brief Verify the cross section data values
*
* The following verification tests are performed:
* - there are at least three values
* - there are at least two values
* - the reaction identifier looks to be an integer
*
* @param[in] data the data values in the cross section subrecord
Expand Down
5 changes: 4 additions & 1 deletion src/NDItk/depletion/ReactionMultiplicities/src/ctor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,17 @@ ReactionMultiplicities( ReactionMultiplicityType type,
ReactionMultiplicities() : IntegerListRecord( base::Keyword( "rprod" ) ) {}

/**
* @brief Default constructor
* @brief Constructor for a multiplicity type
*
* @param[in] type the multiplicity type (all, few or rmo)
*/
ReactionMultiplicities( ReactionMultiplicityType type ) :
IntegerListRecord( base::Keyword( "rprod", type ) ) {}

/**
* @brief Constructor
*
* @param[in] type the multiplicity type (all, few or rmo)
* @param[in] multiplicities the multiplicity data
*/
ReactionMultiplicities( std::vector< Multiplicities > multiplicities ) :
Expand Down
2 changes: 2 additions & 0 deletions src/NDItk/depletion/ReactionMultiplicities/src/read.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
std::vector< int > data;
while ( reactions-- ) {

// read MT number and number of reaction products
data.push_back( njoy::tools::disco::FreeFormatInteger::read< int >( iter, end ) );
data.push_back( njoy::tools::disco::FreeFormatInteger::read< int >( iter, end ) );
int number = data.back();
Expand All @@ -24,6 +25,7 @@
}
else {

// read 2 numbers for each reaction product
number *= 2;
while ( number-- ) {

Expand Down
1 change: 0 additions & 1 deletion src/NDItk/depletion/ReactionMultiplicities/src/verify.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
*
* The following verification tests are performed:
* - there is at least one reaction
* - the number of groups for each reaction is the same
*
* @param[in] reactions the reactions to be verified
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ void verifyChunk( const ReactionMultiplicities& chunk ) {
CHECK( 2 == chunk.reactions()[1].multiplicities()[0] );
CHECK( 1 == chunk.reactions()[1].multiplicities()[1] );

auto multiplicities = chunk.reaction( 2 );
CHECK( 2 == chunk.reaction( 2 ).identifier() );
CHECK( 2 == chunk.reaction( 2 ).numberReactionProducts() );
CHECK( 1 == chunk.reaction( 2 ).reactionProducts()[0] );
Expand Down
2 changes: 1 addition & 1 deletion src/NDItk/multigroup/AverageFissionEnergyRelease.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace multigroup {

/**
* @brief An average fission energy release record for multigroup
* neutron and photon data
* neutron data
*/
class AverageFissionEnergyRelease : protected base::RealListRecord {

Expand Down
2 changes: 1 addition & 1 deletion src/NDItk/multigroup/CrossSection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace NDItk {
namespace multigroup {

/**
* @brief A cross section subrecord for multigroup neutron and photon data
* @brief A cross section subrecord for multigroup neutron data
*/
class CrossSection : protected base::SubListRecord< CrossSection, double > {

Expand Down
2 changes: 1 addition & 1 deletion src/NDItk/multigroup/EnergyGroupStructure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace NDItk {
namespace multigroup {

/**
* @brief An energy group structure record for multigroup neutron and photon data
* @brief An energy group structure record for multigroup neutron data
*
* This corresponds to an e_bounds or e_bounds_x record for the primary
* energy boundaries or outgoing particle energy boundaries.
Expand Down
2 changes: 1 addition & 1 deletion src/NDItk/multigroup/FissionNeutronMultiplicity.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace NDItk {
namespace multigroup {

/**
* @brief A fission neutron multiplicity record for multigroup neutron and photon data
* @brief A fission neutron multiplicity record for multigroup neutron data
*/
class FissionNeutronMultiplicity : protected base::RealListRecord {

Expand Down
5 changes: 4 additions & 1 deletion src/NDItk/multigroup/FissionNeutronMultiplicity/src/ctor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@
FissionNeutronMultiplicity() : RealListRecord( base::Keyword( "nu" ) ) {}

/**
* @brief Default constructor
* @brief Constructor for a fission type
*
* @param[in] type the fission type (prompt, delayed or total)
*/
FissionNeutronMultiplicity( FissionType type ) : RealListRecord( base::Keyword( "nu", type ) ) {}

/**
* @brief Constructor
*
* @param[in] type the fission type (prompt, delayed or total)
* @param[in] values the fission neutron multiplicity values
*/
FissionNeutronMultiplicity( FissionType type,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ SCENARIO( "FissionNeutronMultiplicity" ) {

GIVEN( "invalid data for a FissionNeutronMultiplicity instance" ) {

WHEN( "the number of weight values is insufficient" ) {
WHEN( "the number of multiplicity values is insufficient" ) {

THEN( "an exception is thrown" ) {

Expand Down
2 changes: 1 addition & 1 deletion src/NDItk/multigroup/FissionNeutronProduction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace NDItk {
namespace multigroup {

/**
* @brief A fission neutron production record for multigroup neutron and photon data
* @brief A fission neutron production record for multigroup neutron data
*/
class FissionNeutronProduction : protected base::RealListRecord {

Expand Down
5 changes: 4 additions & 1 deletion src/NDItk/multigroup/FissionNeutronProduction/src/ctor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@
FissionNeutronProduction() : RealListRecord( base::Keyword( "nu_sig_f" ) ) {}

/**
* @brief Default constructor
* @brief Constructor for a fission type
*
* @param[in] type the fission type (prompt, delayed or total)
*/
FissionNeutronProduction( FissionType type ) : RealListRecord( base::Keyword( "nu_sig_f", type ) ) {}

/**
* @brief Constructor
*
* @param[in] type the fission type (prompt, delayed or total)
* @param[in] values the fission neutron production values
*/
FissionNeutronProduction( FissionType type,
Expand Down
2 changes: 1 addition & 1 deletion src/NDItk/multigroup/FissionNeutronSpectrumMatrix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace NDItk {
namespace multigroup {

/**
* @brief A fission neutron spectrum matrix record for multigroup neutron and photon data
* @brief A fission neutron spectrum matrix record for multigroup neutron data
*/
class FissionNeutronSpectrumMatrix : protected base::RealListRecord {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@
FissionNeutronSpectrumMatrix() : RealListRecord( base::Keyword( "chi_mat" ) ) {}

/**
* @brief Default constructor
* @brief Constructor for a fission type
*
* @param[in] type the fission type (prompt, delayed or total)
*/
FissionNeutronSpectrumMatrix( FissionType type ) : RealListRecord( base::Keyword( "chi_mat", type ) ) {}

/**
* @brief Constructor
*
* @param[in] type the fission type (prompt, delayed or total)
* @param[in] values the fission neutron spectrum matrix values
*/
FissionNeutronSpectrumMatrix( FissionType type,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*
* The following verification tests are performed:
* - there is at least one value
* - verify matrix size
*
* @param[in] values the production values to be verified
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ SCENARIO( "FissionNeutronSpectrumMatrix" ) {

GIVEN( "invalid data for a FissionNeutronSpectrumMatrix instance" ) {

WHEN( "the number of weight values is insufficient" ) {
WHEN( "the number of matrix values is insufficient" ) {

THEN( "an exception is thrown" ) {

Expand All @@ -88,6 +88,16 @@ SCENARIO( "FissionNeutronSpectrumMatrix" ) {
} // THEN
} // WHEN

WHEN( "the matrix is not square" ) {

THEN( "an exception is thrown" ) {

std::vector< double > three = { 1., 2., 3. };

CHECK_THROWS( FissionNeutronSpectrumMatrix( FissionType::Prompt, std::move( three ) ) );
} // THEN
} // WHEN

WHEN( "reading the data of the record and the number of "
"values is insufficient" ) {

Expand Down
2 changes: 1 addition & 1 deletion src/NDItk/multigroup/FissionNeutronSpectrumVector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace NDItk {
namespace multigroup {

/**
* @brief A fission neutron spectrum vector record for multigroup neutron and photon data
* @brief A fission neutron spectrum vector record for multigroup neutron data
*/
class FissionNeutronSpectrumVector : protected base::RealListRecord {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@
FissionNeutronSpectrumVector() : RealListRecord( base::Keyword( "chi_vec" ) ) {}

/**
* @brief Default constructor
* @brief Constructor for a fission type
*
* @param[in] type the fission type (prompt, delayed or total)
*/
FissionNeutronSpectrumVector( FissionType type ) : RealListRecord( base::Keyword( "chi_vec", type ) ) {}

/**
* @brief Constructor
*
* @param[in] type the fission type (prompt, delayed or total)
* @param[in] values the fission neutron spectrum vector values
*/
FissionNeutronSpectrumVector( FissionType type,
Expand Down
2 changes: 1 addition & 1 deletion src/NDItk/multigroup/FluxWeights.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace NDItk {
namespace multigroup {

/**
* @brief A flux weight record for multigroup neutron and photon data
* @brief A flux weight record for multigroup neutron data
*/
class FluxWeights : protected base::RealListRecord {

Expand Down
2 changes: 1 addition & 1 deletion src/NDItk/multigroup/HeatingNumbers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace NDItk {
namespace multigroup {

/**
* @brief A heating numbers record for multigroup neutron and photon data
* @brief A heating numbers record for multigroup neutron data
*/
class HeatingNumbers : protected base::RealListRecord {

Expand Down
2 changes: 1 addition & 1 deletion src/NDItk/multigroup/Kerma.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace NDItk {
namespace multigroup {

/**
* @brief A kerma record for multigroup neutron and photon data
* @brief A kerma record for multigroup neutron data
*/
class Kerma : protected base::RealListRecord {

Expand Down
2 changes: 1 addition & 1 deletion src/NDItk/multigroup/LegendreMoment.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace NDItk {
namespace multigroup {

/**
* @brief A Legendre moment subrecord for multigroup neutron and photon data
* @brief A Legendre moment subrecord for multigroup neutron data
*/
class LegendreMoment : protected base::SubListRecord< LegendreMoment, double > {

Expand Down
2 changes: 1 addition & 1 deletion src/NDItk/multigroup/Metadata.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace NDItk {
namespace multigroup {

/**
* @brief Metadata associated with multigroup neutron and photon data
* @brief Metadata associated with multigroup neutron data
*/
class Metadata {

Expand Down
2 changes: 1 addition & 1 deletion src/NDItk/multigroup/OutgoingParticleTransportData.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace NDItk {
namespace multigroup {

/**
* @brief An outgoing particle type record for multigroup neutron and photon data
* @brief An outgoing particle type record for multigroup neutron data
*/
class OutgoingParticleTransportData : protected base::StringListRecord {

Expand Down
2 changes: 1 addition & 1 deletion src/NDItk/multigroup/OutgoingParticleTypes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace NDItk {
namespace multigroup {

/**
* @brief An outgoing particle type record for multigroup neutron and photon data
* @brief An outgoing particle type record for multigroup neutron data
*/
class OutgoingParticleTypes : protected base::IntegerListRecord {

Expand Down
Loading

0 comments on commit 62c0d5a

Please sign in to comment.