Skip to content

Commit

Permalink
take Version and PicsarVersion out of the WarpX class
Browse files Browse the repository at this point in the history
  • Loading branch information
lucafedeli88 committed Jun 3, 2024
1 parent 7f4b086 commit 5bf5712
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 15 deletions.
3 changes: 2 additions & 1 deletion Source/Diagnostics/WarpXOpenPMD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "Utils/RelativeCellPosition.H"
#include "Utils/WarpXAlgorithmSelection.H"
#include "Utils/WarpXProfilerWrapper.H"
#include "Utils/WarpXVersion.H"
#include "WarpX.H"
#include "OpenPMDHelpFunction.H"

Expand Down Expand Up @@ -518,7 +519,7 @@ WarpXOpenPMDPlot::Init (openPMD::Access access, bool isBTD)
uint32_t const openPMD_ED_PIC = 1u;
m_Series->setOpenPMDextension( openPMD_ED_PIC );
// meta info
m_Series->setSoftware( "WarpX", WarpX::Version() );
m_Series->setSoftware( "WarpX", warpx::Version() );
}

void
Expand Down
5 changes: 3 additions & 2 deletions Source/Initialization/WarpXInitData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "Utils/WarpXConst.H"
#include "Utils/WarpXProfilerWrapper.H"
#include "Utils/WarpXUtil.H"
#include"Utils/WarpXVersion.H"
#include "Python/callbacks.H"

#include <ablastr/parallelization/MPIInitHelpers.H>
Expand Down Expand Up @@ -430,10 +431,10 @@ WarpX::InitData ()
ablastr::parallelization::check_mpi_thread_level();

#ifdef WARPX_QED
Print() << "PICSAR (" << WarpX::PicsarVersion() << ")\n";
Print() << "PICSAR (" << warpx::PicsarVersion() << ")\n";
#endif

Print() << "WarpX (" << WarpX::Version() << ")\n";
Print() << "WarpX (" << warpx::Version() << ")\n";

Print() << utils::logo::get_logo();

Expand Down
2 changes: 1 addition & 1 deletion Source/Python/pyWarpX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ PYBIND11_MODULE(PYWARPX_MODULE_NAME, m) {
m.attr("__version__") = MACRO_STRINGIFY(PYWARPX_VERSION_INFO);
#else
// note: not necessarily PEP-440 compliant
m.attr("__version__") = WarpX::Version();
m.attr("__version__") = warpx::Version();
#endif

// authors
Expand Down
9 changes: 9 additions & 0 deletions Source/Utils/WarpXVersion.H.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#ifndef WARPX_VERSION_H_
#define WARPX_VERSION_H_

#include <string>

#ifndef WARPX_GIT_VERSION
# define WARPX_GIT_VERSION "@WarpX_GIT_VERSION@"
#endif
Expand All @@ -15,4 +17,11 @@
# define PICSAR_GIT_VERSION "@PXRMP_QED_GIT_VERSION@"
#endif

namespace warpx
{
[[nodiscard]] std::string Version () noexcept; //!< Version of WarpX executable

[[nodiscard]] std::string PicsarVersion () noexcept; //!< Version of PICSAR dependency
}

#endif // WARPX_VERSION_H_
10 changes: 2 additions & 8 deletions Source/Utils/WarpXVersion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,9 @@
*
* License: BSD-3-Clause-LBNL
*/
#include "WarpX.H"
#include "Utils/WarpXVersion.H"

#include <string>


std::string
WarpX::Version ()
std::string warpx::Version () noexcept
{
std::string version;
#ifdef WARPX_GIT_VERSION
Expand All @@ -24,8 +19,7 @@ WarpX::Version ()
}
}

std::string
WarpX::PicsarVersion ()
std::string warpx::PicsarVersion () noexcept
{
std::string version;
#ifdef PICSAR_GIT_VERSION
Expand Down
3 changes: 0 additions & 3 deletions Source/WarpX.H
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,6 @@ public:
/** Move operator */
WarpX& operator= ( WarpX && ) = default;

static std::string Version (); //!< Version of WarpX executable
static std::string PicsarVersion (); //!< Version of PICSAR dependency

[[nodiscard]] int Verbose () const { return verbose; }

void InitData ();
Expand Down

0 comments on commit 5bf5712

Please sign in to comment.