Skip to content

Commit

Permalink
Merge pull request #195 from njoy/develop
Browse files Browse the repository at this point in the history
ENDFtk v1.0.1
  • Loading branch information
whaeck authored Mar 21, 2024
2 parents 6550e07 + 20a2aaf commit 7d9fb07
Show file tree
Hide file tree
Showing 195 changed files with 283 additions and 194 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ cmake -DCMAKE_BUILD_TYPE=Release ../
make -j8
```

ENDFtk in python requires python 3.x so you will need to have at least one python 3.x installed. When multiple python versions are installed, it may be beneficial to include ```-DPYTHON_EXECUTABLE=$(which python3)``` in the cmake configuration step so that the default python3 version will be picked. The compilation will produce a dynamic library linked to the python libraries on the user's computer (it'll be named something like `ENDFtk.cpython-37m-darwin.so`). This name will also indicate which version of the python libraries this library is linked to. This is important since you will need to use the associated python version with the ENDFtk python package.
The compilation will produce a number of dynamic libraries linked to the python libraries on the user's computer (these will be named something like `< component >.cpython-37m-darwin.so` with `< component >` the name of the component). The names of these dynamic libraries will also indicate which version of the python libraries they are linked against. This is important since you will need to use the associated python version along with them.

ENDFtk in python requires python 3.x so you will need to have at least one python 3.x installed. When multiple python versions are installed, it may be beneficial to include ```-DPYTHON_EXECUTABLE=$(which python3)``` in the cmake configuration step so that the default python3 version will be picked.

In order to use the ENDFtk python package, the user should make sure that the library is within the python path. This can be done in multiple ways. You can set that up by adding the ENDFtk build path to the python path `$PYTHONPATH` environmental variable on your machine, or by using the following in your python code:
```
Expand Down Expand Up @@ -125,4 +127,5 @@ sections = file.sections.copy() # this is a list of MF6 sections that have be
```

## LICENSE
The software contained in this repository is covered under the associated [LICENSE](LICENSE) file.
This software is copyrighted by Los Alamos National Laboratory and distributed
according to the conditions in the accompanying [LICENSE](LICENSE) file.
3 changes: 2 additions & 1 deletion ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Release Notes&mdash;ENDFtk
Given here are some release notes for ENDFtk.

## [ENDFtk v1.0.1](https://github.com/njoy/ENDFtk/pull/194)
## [ENDFtk v1.0.1](https://github.com/njoy/ENDFtk/pull/195)
This update does not add any additional functionality.

This update fixes the following issues:
- A compilation issue in a unit test that still used the old catch-adapter (see issue #193).
- Macros for pybind11 were added where required so that other pybind11 bond libraries can accept ENDFtk components as input arguments on the python side (e.g. covariance matrice blocks). This is currently limited to all ENDFtk section components.

## [ENDFtk v1.0.0](https://github.com/njoy/ENDFtk/pull/192)
This release of ENDFtk has the following changes:
Expand Down
18 changes: 18 additions & 0 deletions src/ENDFtk/macros.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#ifndef NJOY_ENDFTK_PYBIND11_MACROS
#define NJOY_ENDFTK_PYBIND11_MACROS

// include files
#ifdef PYBIND11
#include <pybind11/detail/common.h>
#endif

// define PYTHON_EXPORT macro but only when PYBIND11 is defined
#if !defined(PYTHON_EXPORT)
# ifdef PYBIND11
# define ENDFTK_PYTHON_EXPORT PYBIND11_EXPORT
# else
# define ENDFTK_PYTHON_EXPORT
# endif
#endif

#endif
4 changes: 3 additions & 1 deletion src/ENDFtk/section/1/451.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "range/v3/view/single.hpp"
#include "range/v3/view/split.hpp"
#include "range/v3/view/transform.hpp"
#include "ENDFtk/macros.hpp"
#include "ENDFtk/TextRecord.hpp"
#include "ENDFtk/HeadRecord.hpp"
#include "ENDFtk/ControlRecord.hpp"
Expand All @@ -30,7 +31,8 @@ namespace section {
* See ENDF102, section 1.1 for more information.
*/
template<>
class Type< 1, 451 > : protected BaseWithoutMT< Type< 1, 451 > > {
class ENDFTK_PYTHON_EXPORT Type< 1, 451 > :
protected BaseWithoutMT< Type< 1, 451 > > {

friend BaseWithoutMT< Type< 1, 451 > >;

Expand Down
4 changes: 3 additions & 1 deletion src/ENDFtk/section/1/452.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <variant>

// other includes
#include "ENDFtk/macros.hpp"
#include "ENDFtk/HeadRecord.hpp"
#include "ENDFtk/ControlRecord.hpp"
#include "ENDFtk/section.hpp"
Expand All @@ -24,7 +25,8 @@ namespace section {
* See ENDF102, section 1.2 for more information.
*/
template<>
class Type< 1, 452 > : protected BaseWithoutMT< Type< 1, 452 > > {
class ENDFTK_PYTHON_EXPORT Type< 1, 452 > :
protected BaseWithoutMT< Type< 1, 452 > > {

friend BaseWithoutMT< Type< 1, 452 > >;

Expand Down
4 changes: 3 additions & 1 deletion src/ENDFtk/section/1/455.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <variant>

// other includes
#include "ENDFtk/macros.hpp"
#include "ENDFtk/TabulationRecord.hpp"
#include "ENDFtk/ListRecord.hpp"
#include "ENDFtk/InterpolationSequenceRecord.hpp"
Expand All @@ -29,7 +30,8 @@ namespace section{
* See ENDF102, section 1.3 for more information.
*/
template<>
class Type< 1, 455 > : protected BaseWithoutMT< Type< 1, 455 > > {
class ENDFTK_PYTHON_EXPORT Type< 1, 455 > :
protected BaseWithoutMT< Type< 1, 455 > > {

friend BaseWithoutMT< Type< 1, 455 > >;

Expand Down
2 changes: 1 addition & 1 deletion src/ENDFtk/section/1/455/DecayConstants.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* See ENDF102, section 1.3 for more information.
*/
class DecayConstants : protected ListRecord {
class ENDFTK_PYTHON_EXPORT DecayConstants : protected ListRecord {

/* auxiliary functions */
#include "ENDFtk/section/1/455/DecayConstants/src/generateList.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/ENDFtk/section/1/455/EnergyDependentConstants.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* See ENDF102, section 1.3 for more information.
*/
class EnergyDependentConstants :
class ENDFTK_PYTHON_EXPORT EnergyDependentConstants :
protected InterpolationSequenceRecord< DecayConstants > {

/* auxiliary functions */
Expand Down
2 changes: 1 addition & 1 deletion src/ENDFtk/section/1/455/EnergyIndependentConstants.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* See ENDF102, section 1.3 for more information.
*/
class EnergyIndependentConstants : protected ListRecord {
class ENDFTK_PYTHON_EXPORT EnergyIndependentConstants : protected ListRecord {

public:

Expand Down
4 changes: 3 additions & 1 deletion src/ENDFtk/section/1/456.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <variant>

// other includes
#include "ENDFtk/macros.hpp"
#include "ENDFtk/HeadRecord.hpp"
#include "ENDFtk/ControlRecord.hpp"
#include "ENDFtk/section.hpp"
Expand All @@ -28,7 +29,8 @@ namespace section {
* See ENDF102, section 1.4 for more information.
*/
template<>
class Type< 1, 456 > : protected BaseWithoutMT< Type< 1, 456 > > {
class ENDFTK_PYTHON_EXPORT Type< 1, 456 > :
protected BaseWithoutMT< Type< 1, 456 > > {

friend BaseWithoutMT< Type< 1, 456 > >;

Expand Down
4 changes: 3 additions & 1 deletion src/ENDFtk/section/1/458.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <optional>

// other includes
#include "ENDFtk/macros.hpp"
#include "ENDFtk/HeadRecord.hpp"
#include "ENDFtk/ControlRecord.hpp"
#include "ENDFtk/ListRecord.hpp"
Expand All @@ -26,7 +27,8 @@ namespace section{
* See ENDF102, section 1.5 for more information.
*/
template<>
class Type< 1, 458 > : protected BaseWithoutMT< Type< 1, 458 > > {
class ENDFTK_PYTHON_EXPORT Type< 1, 458 > :
protected BaseWithoutMT< Type< 1, 458 > > {

friend BaseWithoutMT< Type< 1, 458 > >;

Expand Down
2 changes: 1 addition & 1 deletion src/ENDFtk/section/1/458/EnergyReleaseComponent.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* See ENDF102, section 1.5 for more information.
*/
class EnergyReleaseComponent : protected TabulationRecord {
class ENDFTK_PYTHON_EXPORT EnergyReleaseComponent : protected TabulationRecord {

/* auxiliary functions */
#include "ENDFtk/section/1/458/EnergyReleaseComponent/src/verify.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/ENDFtk/section/1/458/PolynomialComponents.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* See ENDF102, section 1.5 for more information.
*/
class PolynomialComponents : protected ListRecord {
class ENDFTK_PYTHON_EXPORT PolynomialComponents : protected ListRecord {

/* auxiliary functions */
#include "ENDFtk/section/1/458/PolynomialComponents/src/verify.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/ENDFtk/section/1/458/TabulatedComponents.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* See ENDF102, section 1.5 for more information.
*/
class TabulatedComponents {
class ENDFTK_PYTHON_EXPORT TabulatedComponents {

public:

Expand Down
2 changes: 1 addition & 1 deletion src/ENDFtk/section/1/458/ThermalPointComponents.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* See ENDF102, section 1.5 for more information.
*/
class ThermalPointComponents : protected ListRecord {
class ENDFTK_PYTHON_EXPORT ThermalPointComponents : protected ListRecord {

/* auxiliary functions */
#include "ENDFtk/section/1/458/ThermalPointComponents/src/verify.hpp"
Expand Down
4 changes: 3 additions & 1 deletion src/ENDFtk/section/1/460.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <variant>

// other includes
#include "ENDFtk/macros.hpp"
#include "ENDFtk/readSequence.hpp"
#include "ENDFtk/ControlRecord.hpp"
#include "ENDFtk/HeadRecord.hpp"
Expand All @@ -23,7 +24,8 @@ namespace section{
* See ENDF102, section 1.6 for more information.
*/
template<>
class Type< 1, 460 > : protected BaseWithoutMT< Type< 1, 460 > > {
class ENDFTK_PYTHON_EXPORT Type< 1, 460 > :
protected BaseWithoutMT< Type< 1, 460 > > {

friend BaseWithoutMT< Type< 1, 460 > >;

Expand Down
2 changes: 1 addition & 1 deletion src/ENDFtk/section/1/460/ContinuousPhotons.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* See ENDF102, section 1.6 for more information.
*/
class ContinuousPhotons : protected ListRecord {
class ENDFTK_PYTHON_EXPORT ContinuousPhotons : protected ListRecord {

/* auxiliary functions */
#include "ENDFtk/section/1/460/ContinuousPhotons/src/verifySize.hpp"
Expand Down
3 changes: 2 additions & 1 deletion src/ENDFtk/section/1/460/DiscretePhotonMultiplicity.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
*
* See ENDF102, section 1.6 for more information.
*/
class DiscretePhotonMultiplicity : protected TabulationRecord {
class ENDFTK_PYTHON_EXPORT DiscretePhotonMultiplicity :
protected TabulationRecord {

public:

Expand Down
2 changes: 1 addition & 1 deletion src/ENDFtk/section/1/460/DiscretePhotons.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* See ENDF102, section 1.6 for more information.
*/
class DiscretePhotons {
class ENDFTK_PYTHON_EXPORT DiscretePhotons {

/* fields */
std::vector< DiscretePhotonMultiplicity > photons_;
Expand Down
3 changes: 2 additions & 1 deletion src/ENDFtk/section/1/PolynomialMultiplicity.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// system includes

// other includes
#include "ENDFtk/macros.hpp"
#include "ENDFtk/ListRecord.hpp"

namespace njoy {
Expand All @@ -19,7 +20,7 @@ namespace section{
*
* See ENDF102, section 1.2 for more information.
*/
class PolynomialMultiplicity : protected ListRecord {
class ENDFTK_PYTHON_EXPORT PolynomialMultiplicity : protected ListRecord {

public:

Expand Down
3 changes: 2 additions & 1 deletion src/ENDFtk/section/1/TabulatedMultiplicity.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// system includes

// other includes
#include "ENDFtk/macros.hpp"
#include "ENDFtk/TabulationRecord.hpp"

namespace njoy {
Expand All @@ -19,7 +20,7 @@ namespace section{
*
* See ENDF102, section 1.2 for more information.
*/
class TabulatedMultiplicity : protected TabulationRecord {
class ENDFTK_PYTHON_EXPORT TabulatedMultiplicity : protected TabulationRecord {

public:

Expand Down
3 changes: 2 additions & 1 deletion src/ENDFtk/section/10.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// system includes

// other includes
#include "ENDFtk/macros.hpp"
#include "ENDFtk/ControlRecord.hpp"
#include "ENDFtk/TabulationRecord.hpp"
#include "ENDFtk/readSequence.hpp"
Expand All @@ -20,7 +21,7 @@ namespace section {
* See ENDF102, section 10.2 for more information.
*/
template<>
class Type< 10 > : protected Base {
class ENDFTK_PYTHON_EXPORT Type< 10 > : protected Base {

public:

Expand Down
2 changes: 1 addition & 1 deletion src/ENDFtk/section/10/ReactionProduct.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* See ENDF102, section 10.2 for more information.
*/
class ReactionProduct : protected TabulationRecord {
class ENDFTK_PYTHON_EXPORT ReactionProduct : protected TabulationRecord {

/* auxiliary functions */

Expand Down
3 changes: 2 additions & 1 deletion src/ENDFtk/section/12.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
// other includes
#include "range/v3/view/chunk.hpp"
#include "range/v3/view/join.hpp"
#include "ENDFtk/macros.hpp"
#include "ENDFtk/ControlRecord.hpp"
#include "ENDFtk/ListRecord.hpp"
#include "ENDFtk/TabulationRecord.hpp"
Expand All @@ -26,7 +27,7 @@ namespace section {
* See ENDF102, section 12.2 for more information.
*/
template<>
class Type< 12 > : protected Base {
class ENDFTK_PYTHON_EXPORT Type< 12 > : protected Base {

public:

Expand Down
2 changes: 1 addition & 1 deletion src/ENDFtk/section/12/Multiplicities.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* See ENDF102, section 12.2.1 for more information.
*/
class Multiplicities {
class ENDFTK_PYTHON_EXPORT Multiplicities {

public:

Expand Down
2 changes: 1 addition & 1 deletion src/ENDFtk/section/12/PartialMultiplicity.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* See ENDF102, section 12.2.1 for more information.
*/
class PartialMultiplicity : protected TabulationRecord {
class ENDFTK_PYTHON_EXPORT PartialMultiplicity : protected TabulationRecord {

/* auxiliary functions */

Expand Down
2 changes: 1 addition & 1 deletion src/ENDFtk/section/12/TotalMultiplicity.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* See ENDF102, section 12.2.1 for more information.
*/
class TotalMultiplicity : protected TabulationRecord {
class ENDFTK_PYTHON_EXPORT TotalMultiplicity : protected TabulationRecord {

/* auxiliary functions */

Expand Down
2 changes: 1 addition & 1 deletion src/ENDFtk/section/12/TransitionProbabilities.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*
* See ENDF102, section 12.2.2 for more information.
*/
class TransitionProbabilities : protected ListRecord {
class ENDFTK_PYTHON_EXPORT TransitionProbabilities : protected ListRecord {

public:

Expand Down
3 changes: 2 additions & 1 deletion src/ENDFtk/section/13.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <optional>

// other includes
#include "ENDFtk/macros.hpp"
#include "ENDFtk/ControlRecord.hpp"
#include "ENDFtk/ListRecord.hpp"
#include "ENDFtk/TabulationRecord.hpp"
Expand All @@ -23,7 +24,7 @@ namespace section {
* See ENDF102, section 13.2 for more information.
*/
template<>
class Type< 13 > : protected Base {
class ENDFTK_PYTHON_EXPORT Type< 13 > : protected Base {

public:

Expand Down
2 changes: 1 addition & 1 deletion src/ENDFtk/section/13/PartialCrossSection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* See ENDF102, section 13.2 for more information.
*/
class PartialCrossSection : protected TabulationRecord {
class ENDFTK_PYTHON_EXPORT PartialCrossSection : protected TabulationRecord {

/* auxiliary functions */

Expand Down
2 changes: 1 addition & 1 deletion src/ENDFtk/section/13/TotalCrossSection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* See ENDF102, section 13.2 for more information.
*/
class TotalCrossSection : protected TabulationRecord {
class ENDFTK_PYTHON_EXPORT TotalCrossSection : protected TabulationRecord {

/* auxiliary functions */

Expand Down
Loading

0 comments on commit 7d9fb07

Please sign in to comment.