Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
TOUZE Francois
PSPA
Commits
53db3b12
Commit
53db3b12
authored
Dec 17, 2019
by
TOUZE Francois
Browse files
docker containers creation: step 2
parent
58fd6992
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
938 additions
and
2 deletions
+938
-2
controller/cython-cpp/README
controller/cython-cpp/README
+1
-1
controller/cython-cpp/pspaclass.cpp
controller/cython-cpp/pspaclass.cpp
+1
-1
controller/cython-cpp/pspaclass.py
controller/cython-cpp/pspaclass.py
+22
-0
controller/cython-cpp/pspaplot.cpp
controller/cython-cpp/pspaplot.cpp
+839
-0
controller/cython-cpp/pspaplot.h
controller/cython-cpp/pspaplot.h
+38
-0
controller/cython-cpp/pspaplot.pxd
controller/cython-cpp/pspaplot.pxd
+11
-0
controller/cython-cpp/pspaplot.py
controller/cython-cpp/pspaplot.py
+6
-0
controller/cython-cpp/pypspaplot.pyx
controller/cython-cpp/pypspaplot.pyx
+20
-0
No files found.
controller/cython-cpp/README
View file @
53db3b12
...
...
@@ -2,5 +2,5 @@
how to wrap C++ with Cython.
Assuming you have Python, Cython, Git and a C++ compiler installed
$ python
setup
.py build_ext --inplace
$ python
pspaclass
.py build_ext --inplace
controller/cython-cpp/pspaclass.cpp
View file @
53db3b12
#include <iostream>
#include "
cppcode
.h"
#include "
pspaclass
.h"
#include "componentFactory.h"
...
...
controller/cython-cpp/pspaclass.py
0 → 100644
View file @
53db3b12
from
distutils.core
import
setup
from
distutils.extension
import
Extension
from
Cython.Build
import
cythonize
xtension
=
Extension
(
name
=
"pypspaclass"
,
sources
=
[
"pypspaclass.pyx"
,
"/home/pspa/backend/pspa/v0/src/Core/dataManager.cpp"
],
libraries
=
[
"pspa"
,
"uap"
,
"antlr"
,
"xerces-c"
],
include_dirs
=
[
"/home/pspa/backend/pspa/v0/src/Core"
,
"/home/pspa/backend/pspa/v0/src/KindOfElements"
,
"/usr/local/accelerator-ml-code"
,
"/usr/local/json/include"
],
library_dirs
=
[
"/home/pspa/backend/pspa/v0/Linux-x86_64"
,
"/usr/local/accelerator-ml-code/lib"
,
"/usr/local/lib"
]
)
setup
(
name
=
"pypspaclass"
,
ext_modules
=
cythonize
([
xtension
])
)
controller/cython-cpp/pspaplot.cpp
0 → 100644
View file @
53db3b12
This diff is collapsed.
Click to expand it.
controller/cython-cpp/pspaplot.h
0 → 100644
View file @
53db3b12
#ifndef __SETTINGPLOTS_H__
#define __SETTINGPLOTS_H__
#include <string>
#include <vector>
#include <map>
#include <nlohmann/json.hpp>
using
json
=
nlohmann
::
json
;
using
namespace
std
;
class
pspaplot
{
string
userDir_
;
json
phaseSpace
(
json
,
string
);
json
plotSelection
(
json
);
vector
<
double
>
menu1
(
string
,
json
);
map
<
string
,
vector
<
double
>
>
menu2
(
string
,
json
);
json
beamParameters
(
json
);
void
submenu1
(
string
,
json
,
double
&
,
vector
<
double
>&
);
void
submenu2
(
string
,
json
,
map
<
string
,
vector
<
double
>
>&
);
void
menu
(
string
,
json
,
map
<
string
,
vector
<
double
>
>&
);
json
lineplots
(
vector
<
double
>
,
map
<
string
,
vector
<
double
>
>
);
public:
pspaplot
();
pspaplot
(
string
);
~
pspaplot
();
void
settings
(
string
);
};
#endif
controller/cython-cpp/pspaplot.pxd
0 → 100644
View file @
53db3b12
from
libcpp.string
cimport
string
cdef
extern
from
"pspaplot.cpp"
:
pass
cdef
extern
from
"pspaplot.h"
:
cdef
cppclass
pspaplot
:
pspaplot
()
except
+
pspaplot
(
string
)
except
+
void
settings
(
string
)
controller/cython-cpp/pspaplot.py
0 → 100644
View file @
53db3b12
from
distutils.core
import
setup
from
Cython.Build
import
cythonize
setup
(
ext_modules
=
cythonize
(
"pypspaplot.pyx"
)
)
controller/cython-cpp/pypspaplot.pyx
0 → 100644
View file @
53db3b12
# distutils: language = c++
from
pspaplot
cimport
pspaplot
from
libcpp.string
cimport
string
cdef
class
PyPspaPlot
:
cdef
pspaplot
*
ptr
def
__cinit__
(
self
):
self
.
ptr
=
new
pspaplot
()
def
__cinit__
(
self
,
string
s
):
self
.
ptr
=
new
pspaplot
(
s
)
def
__dealloc__
(
self
):
del
self
.
ptr
def
settings
(
self
,
string
s
):
return
self
.
ptr
.
settings
(
s
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment