-
Notifications
You must be signed in to change notification settings - Fork 3
/
FOR_DEVELOPERS
79 lines (50 loc) · 2.11 KB
/
FOR_DEVELOPERS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
one iteration is:
- adapt files in pyOpenMS/pyopenms/pxds
- adapt unittests and maybe memoryleaktests
- run in this directory:
1) generate_code_and_cythonize.bat
2) python setup.py build_ext --inplace
3) run_unittests_with_local_pyopenms.bat
4) maybe: run_memleak_tests.bat
about the unittests / testcoverage:
the unittests have docstrings with sections
"""
@tested
ClassA.method1
.method2
.mehtod3
.__init__
ClassB.method_a
....
@end
"""
these have to be maintained by the developers and
declare which classes and methods from the wrappings
are tested in the corresponding module /class/method.
the script check_test_coverage.py loads _pyOpenMS.pyd,
extracts all wrapped classes and their methods and
compares them with the delcared ones.
at the end the script gives an overview over missing
tests.
about the code generator:
the generator parses .pxd files. that are cython files
which describe the signatures of used c++ classes and their
methods.
the generator then builds cython code for python classes,
the methods of these classes delegate to the corresponding
c++ methods and perform type conversions for input arguments
and the return value.
if you add an #ignore comment to a class or method in a .pxd
file the class or method will be ignored by the code generator
for template classes you have to specify a comment
#inst=<A,...> at the end of "cppclass .." line in the .pxd file.
this describes the classes for instatiating the class.
at the moment this only works for one instantiation.
--> see pyOpenMS\cython_code\pxd\MSExperiment.pxd
the script build_cython_file.py stirs the code generation process
the generated cython code is in pyOpenMS/_pyOpenMS.pyx
if you want to extend the code generator:
- PXDParser.py should be able to parse all pxd statements
unless nested declarations (as inner ::iterator types).
- Most probably you have to extend the conversion functions
in DelegateClassGenerator.py