Skip to content

Commit 12ddb68

Browse files
miloserdova-liakov
andauthored
Update __init__.py (#9)
Change init.py due to update MobileRoboticsSkoltech/mrob/master. Use convenient image, reduce CI spin-up time, simplify CI config. Co-authored-by: iakov <iakov@users.noreply.github.com>
1 parent be210cc commit 12ddb68

File tree

5 files changed

+34
-39
lines changed

5 files changed

+34
-39
lines changed

.circleci/config.yml

Lines changed: 19 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,76 +3,59 @@ version: 2.1
33
jobs:
44
build:
55
docker:
6-
- image: circleci/mariadb:bionic
6+
- image: cimg/base:stable
7+
environment:
8+
PYTHONPATH=./lib
79
steps:
810
- checkout
911
- run:
10-
name: "Update Image"
12+
name: "Install required packages from distro"
1113
command: |
12-
apt-get update && apt-get install -y git
14+
sudo apt-get update
15+
sudo apt-get install -y --no-install-recommends git build-essential g++ cmake python3-distutils python3-dev python3-numpy
1316
- run:
1417
name: "Pull Submodules"
1518
command: |
16-
git submodule update --init --recursive
19+
git submodule update --init --recursive
1720
- run:
18-
name: "Install packages"
21+
name: "Configure and build native mrob library with Python bindings"
1922
command: |
20-
apt-get install -y build-essential cmake python3-distutils python3-dev
21-
apt-get install -y virtualenv
22-
- run:
23-
name: "Build mrob library"
24-
command: |
25-
mkdir build && cd build
26-
cmake .. && make -j
27-
cd ..
28-
- run:
29-
name: "Setup virtualenv"
30-
command: |
31-
virtualenv -p python3 venv
32-
source venv/bin/activate
33-
pip install numpy
23+
mkdir -p build && pushd build
24+
cmake $(dirs -l +1) && make -j 4
25+
popd
3426
- run:
3527
name: "Run FGraph_2d"
3628
command: |
37-
export PYTHONPATH=${PYTHONPATH}:$(pwd)/lib && source venv/bin/activate
3829
python3 mrobpy/tests/FGraph_2d.py
3930
when: always
4031
- run:
4132
name: "Run FGraph_M3500"
4233
command: |
43-
export PYTHONPATH=${PYTHONPATH}:$(pwd)/lib && source venv/bin/activate
44-
cd mrobpy/tests/
45-
python3 FGraph_M3500.py
34+
python3 mrobpy/tests/FGraph_M3500.py
4635
when: always
4736
- run:
4837
name: "Run FGraph_sphere"
4938
command: |
50-
export PYTHONPATH=${PYTHONPATH}:$(pwd)/lib && source venv/bin/activate
51-
cd mrobpy/tests/
52-
python3 FGraph_sphere.py
39+
python3 mrobpy/tests/FGraph_sphere.py
5340
when: always
5441
- run:
5542
name: "Run SE3_examples"
5643
command: |
57-
export PYTHONPATH=${PYTHONPATH}:$(pwd)/lib && source venv/bin/activate
5844
python3 mrobpy/tests/SE3_examples.py
5945
when: always
6046
- run:
6147
name: "Run FGraph_landmark_3d_example"
6248
command: |
63-
export PYTHONPATH=${PYTHONPATH}:$(pwd)/lib && source venv/bin/activate
6449
python3 mrobpy/tests/FGraph_landmark_3d_example.py
6550
when: always
6651
- run:
6752
name: "Run FGraph_landmark_2d_example"
6853
command: |
69-
export PYTHONPATH=${PYTHONPATH}:$(pwd)/lib && source venv/bin/activate
7054
python3 mrobpy/tests/FGraph_landmark_2d_example.py
7155
when: always
7256
- run:
7357
name: "Run PC_align"
7458
command: |
75-
export PYTHONPATH=${PYTHONPATH}:$(pwd)/lib && source venv/bin/activate
7659
python3 mrobpy/tests/PC_align.py
7760
when: always
7861
build-wheel:
@@ -119,16 +102,18 @@ jobs:
119102
${VERSION} ~/project/build/wheelhouse/*.whl
120103
publish-pypi:
121104
docker:
122-
- image: circleci/python:3.8
105+
- image: cimg/python:3.9
123106
steps:
124107
- attach_workspace:
125108
at: ~/
126109
- run:
127110
name: Upload to PyPI
128111
command: |
129-
echo -e "[pypi]" >> ~/.pypirc
130-
echo -e "username = __token__" >> ~/.pypirc
131-
echo -e "password = $PYPI_PASSWORD" >> ~/.pypirc
112+
cat >> ~/.pypirc \<< EOD
113+
[pypi]
114+
username = __token__
115+
password = $PYPI_PASSWORD
116+
EOD
132117
python3 -m pip install --user --upgrade twine
133118
twine upload ~/project/build/wheelhouse/*.whl
134119

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ bin/
1919
*.pdf
2020
*.pkl
2121

22-
mrob/
22+
mrob
2323
dist/
2424
mrob.egg-info/

__init__.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,16 @@
2121
#
2222

2323
from mrob import mrob
24-
fgraph = mrob.fgraph
24+
25+
FGraph = mrob.FGraph
26+
GN = mrob.GN
27+
LEVENBERG_MARQUARDT_ELLIP = mrob.LEVENBERG_MARQUARDT_ELLIP
28+
LEVENBERG_MARQUARDT_SPHER = mrob.LEVENBERG_MARQUARDT_SPHER
29+
LM = mrob.LM
30+
NEWTON_RAPHSON = mrob.NEWTON_RAPHSON
2531
geometry = mrob.geometry
32+
optimMethod = mrob.optimMethod
33+
ostream_redirect = mrob.ostream_redirect
2634
registration = mrob.registration
35+
2736
del(mrob)

mrobpy/tests/FGraph_M3500.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
#
22
import mrob
33
import numpy as np
4+
from os import path
45
import time
56

67

7-
88
# Initialize data structures
99
vertex_ini = {}
1010
factors = {}
1111
factors_dictionary = {}
1212
N = 3500
1313

1414
# load file
15-
with open('../../benchmarks/M3500.txt', 'r') as file:
15+
with open(path.join(path.dirname(__file__), '../../benchmarks/M3500.txt'), 'r') as file:
1616
for line in file:
1717
d = line.split()
1818
# read edges and vertex, in TORO format

mrobpy/tests/FGraph_sphere.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#
22
import mrob
33
import numpy as np
4+
from os import path
45
import time
56

67
# Initialize data structures
@@ -14,7 +15,7 @@
1415
# load file, .g2o format from https://github.com/RainerKuemmerle/g2o/wiki/File-Format
1516
#file_path = '../../benchmarks/sphere_gt.g2o'
1617
file_path = '../../benchmarks/sphere.g2o'
17-
with open(file_path, 'r') as file:
18+
with open(path.join(path.dirname(__file__), file_path), 'r') as file:
1819
for line in file:
1920
d = line.split()
2021
# read edges and vertex

0 commit comments

Comments
 (0)