Skip to content
Snippets Groups Projects
Commit 82b69d1c authored by Tamas Gal's avatar Tamas Gal :speech_balloon:
Browse files

Merge branch '6-installing-jppy-does-not-work-on-my-macos-system' into 'master'

Resolve "Installing Jppy does not work on my MacOS system"

Closes #6

See merge request !8
parents 887de5fe 5247f02f
No related branches found
No related tags found
1 merge request!8Resolve "Installing Jppy does not work on my MacOS system"
Pipeline #30889 passed
#!/usr/bin/env bash #!/usr/bin/env bash
export URL="http://sftp.km3net.de/data/latest/" export URL="https://sftp.km3net.de/data/v17.0.0/"
if [ ! -d "pdfs" ]; then if [ ! -d "pdfs" ]; then
echo "Retrieving PDFs..." echo "Retrieving PDFs..."
mkdir pdfs mkdir pdfs
......
...@@ -8,22 +8,30 @@ ...@@ -8,22 +8,30 @@
* \author mdejong * \author mdejong
*/ */
namespace std { #include <vector>
template<class JElement_t, class JAllocator_t> class vector; #include <set>
template<class JElement_t, class JComparator_t, class JAllocator_t> class set; #include <utility>
template<class JElement_t, class JComparator_t, class JAllocator_t> class multiset; #include <map>
template<class JFirst_t, class JSecond_t> class pair; #include <list>
template<class JKey_t, class JValue_t, class JComparator_t, class JAllocator_t> class map; #include <iterator>
template<class JKey_t, class JValue_t, class JComparator_t, class JAllocator_t> class multimap;
template<class Category, class T, class Distance, class Pointer, class Reference> struct iterator; // TODO: this gives an ambigous error on macOS with std::pair
#ifdef _GLIBCXX_USE_CXX11_ABI // namespace std {
inline namespace __cxx11 { // template<class JElement_t, class JAllocator_t> class vector;
template<class JElement_t, class JAllocator_t> class list; // template<class JElement_t, class JComparator_t, class JAllocator_t> class set;
} // template<class JElement_t, class JComparator_t, class JAllocator_t> class multiset;
#else // template<class JFirst_t, class JSecond_t> struct pair;
template<class JElement_t, class JAllocator_t> class list; // template<class JKey_t, class JValue_t, class JComparator_t, class JAllocator_t> class map;
#endif // template<class JKey_t, class JValue_t, class JComparator_t, class JAllocator_t> class multimap;
} // template<class Category, class T, class Distance, class Pointer, class Reference> struct iterator;
// #ifdef _GLIBCXX_USE_CXX11_ABI
// inline namespace __cxx11 {
// template<class JElement_t, class JAllocator_t> class list;
// }
// #else
// template<class JElement_t, class JAllocator_t> class list;
// #endif
// }
#endif #endif
...@@ -32,7 +32,7 @@ namespace JMATH { ...@@ -32,7 +32,7 @@ namespace JMATH {
/** /**
* Power \f$x^y\f$. * Power \f$ x^{y} \f$.
* *
* \param x value * \param x value
* \param y power * \param y power
...@@ -54,7 +54,7 @@ namespace JMATH { ...@@ -54,7 +54,7 @@ namespace JMATH {
private: private:
/** /**
* Power \f$x^y\f$. * Power \f$ x^{y} \f$.
* This method corresponds to primitive data types. * This method corresponds to primitive data types.
* *
* \param x value * \param x value
...@@ -70,8 +70,8 @@ namespace JMATH { ...@@ -70,8 +70,8 @@ namespace JMATH {
/** /**
* Power \f$x^y\f$. * Power \f$ x^{y} \f$.
* Power. *
* This method corresponds to non-primitive data types. * This method corresponds to non-primitive data types.
* *
* \param x value * \param x value
...@@ -88,7 +88,7 @@ namespace JMATH { ...@@ -88,7 +88,7 @@ namespace JMATH {
/** /**
* Power \f$x^y\f$. * Power \f$ x^{y} \f$.
* *
* \param x value * \param x value
* \param y power * \param y power
...@@ -296,7 +296,7 @@ namespace JMATH { ...@@ -296,7 +296,7 @@ namespace JMATH {
*/ */
friend T& operator*=(T& first, const T& second) friend T& operator*=(T& first, const T& second)
{ {
return first.mul(second); return static_cast<JMath<T>&>(first).mul(second);
} }
...@@ -483,7 +483,7 @@ namespace JMATH { ...@@ -483,7 +483,7 @@ namespace JMATH {
* Template definition so that compiler error is generated if implementation is missing (see JEigen3D.hh). * Template definition so that compiler error is generated if implementation is missing (see JEigen3D.hh).
*/ */
template<> template<>
class JAverage<JGEOMETRY3D::JQuaternion3D>; struct JAverage<JGEOMETRY3D::JQuaternion3D>;
/** /**
......
...@@ -7,16 +7,16 @@ class TestMuonPDF(unittest.TestCase): ...@@ -7,16 +7,16 @@ class TestMuonPDF(unittest.TestCase):
def test_pdf(self): def test_pdf(self):
muon_pdf = jppy.pdf.JMuonPDF(PDFS, 0) muon_pdf = jppy.pdf.JMuonPDF(PDFS, 0)
result = muon_pdf.calculate(10, 5, 0, 0, 23) result = muon_pdf.calculate(10, 5, 0, 0, 23)
self.assertAlmostEqual(0.001545692, result.f) self.assertAlmostEqual(0.00067762789, result.f)
self.assertAlmostEqual(-1.220889709e-05, result.fp) self.assertAlmostEqual(-1.9661888268460384e-05, result.fp)
self.assertAlmostEqual(0.022764524, result.v) self.assertAlmostEqual(0.01374949305, result.v)
self.assertAlmostEqual(0.115814468, result.V) self.assertAlmostEqual(0.053314508, result.V)
class TestShowerPDF(unittest.TestCase): class TestShowerPDF(unittest.TestCase):
def test_pdf(self): def test_pdf(self):
shower_pdf = jppy.pdf.JShowerPDF(PDFS, 0) shower_pdf = jppy.pdf.JShowerPDF(PDFS, 0)
result = shower_pdf.calculate(100, 10, 0.1, 0.2, 0.3, 6) result = shower_pdf.calculate(100, 10, 0.1, 0.2, 0.3, 6)
self.assertAlmostEqual(0.001383343, result.f) self.assertAlmostEqual(0.0013937540, result.f)
self.assertAlmostEqual(5.091930537e-05, result.fp) self.assertAlmostEqual(5.1614638414144165e-05, result.fp)
self.assertAlmostEqual(0.010475308, result.v) self.assertAlmostEqual(0.01054815545, result.v)
self.assertAlmostEqual(0.149635554, result.V) self.assertAlmostEqual(0.150554603, result.V)
...@@ -8,20 +8,17 @@ class TestMuonPDFEvaluator(unittest.TestCase): ...@@ -8,20 +8,17 @@ class TestMuonPDFEvaluator(unittest.TestCase):
E, t0, t_obs, D, cd, theta, phi = [1e3, 56, 292, 50, 0.7, 1.57, 3.14] E, t0, t_obs, D, cd, theta, phi = [1e3, 56, 292, 50, 0.7, 1.57, 3.14]
muon_pdf = jppy.pdf_evaluator.MuonPDF(PDFS, E, t0) muon_pdf = jppy.pdf_evaluator.MuonPDF(PDFS, E, t0)
result = muon_pdf.evaluate(D, cd, theta, phi, t_obs) result = muon_pdf.evaluate(D, cd, theta, phi, t_obs)
self.assertAlmostEqual( 0.003644475, result.f) self.assertAlmostEqual( 0.00388579021, result.f)
self.assertAlmostEqual(-0.000715558, result.fp) self.assertAlmostEqual(-0.000739757, result.fp)
self.assertAlmostEqual( 0.033748905, result.v) self.assertAlmostEqual(0.035047945, result.v)
self.assertAlmostEqual( 0.097171157, result.V) self.assertAlmostEqual(0.09606971431, result.V)
class TestShowerPDFEvaluator(unittest.TestCase): class TestShowerPDFEvaluator(unittest.TestCase):
def test_pdf_evaluator(self): def test_pdf_evaluator(self):
E, t0, t_obs, D, cd, theta, phi = [50, 198, 226, 5, 0.6, 0.5, 0.4] E, t0, t_obs, D, cd, theta, phi = [50, 198, 226, 5, 0.6, 0.5, 0.4]
shower_pdf = jppy.pdf_evaluator.ShowerPDF(PDFS, E, t0) shower_pdf = jppy.pdf_evaluator.ShowerPDF(PDFS, E, t0)
result = shower_pdf.evaluate(D, cd, theta, phi, t_obs) result = shower_pdf.evaluate(D, cd, theta, phi, t_obs)
self.assertAlmostEqual(0.006204617, result.f) self.assertAlmostEqual(0.006247665, result.f)
self.assertAlmostEqual(0.000641669, result.fp) self.assertAlmostEqual(0.0006429129, result.fp)
self.assertAlmostEqual(0.013960066, result.v) self.assertAlmostEqual(0.01406847423, result.v)
self.assertAlmostEqual(0.296589983, result.V) self.assertAlmostEqual(0.297769976, result.V)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment