Skip to content

Commit

Permalink
Update __init__.py
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
2 people authored and anastasiia-kornilova committed Apr 20, 2021
1 parent 9838b16 commit afc9ef3
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 39 deletions.
53 changes: 19 additions & 34 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,76 +3,59 @@ version: 2.1
jobs:
build:
docker:
- image: circleci/mariadb:bionic
- image: cimg/base:stable
environment:
PYTHONPATH=./lib
steps:
- checkout
- run:
name: "Update Image"
name: "Install required packages from distro"
command: |
apt-get update && apt-get install -y git
sudo apt-get update
sudo apt-get install -y --no-install-recommends git build-essential g++ cmake python3-distutils python3-dev python3-numpy
- run:
name: "Pull Submodules"
command: |
git submodule update --init --recursive
git submodule update --init --recursive
- run:
name: "Install packages"
name: "Configure and build native mrob library with Python bindings"
command: |
apt-get install -y build-essential cmake python3-distutils python3-dev
apt-get install -y virtualenv
- run:
name: "Build mrob library"
command: |
mkdir build && cd build
cmake .. && make -j
cd ..
- run:
name: "Setup virtualenv"
command: |
virtualenv -p python3 venv
source venv/bin/activate
pip install numpy
mkdir -p build && pushd build
cmake $(dirs -l +1) && make -j 4
popd
- run:
name: "Run FGraph_2d"
command: |
export PYTHONPATH=${PYTHONPATH}:$(pwd)/lib && source venv/bin/activate
python3 mrobpy/tests/FGraph_2d.py
when: always
- run:
name: "Run FGraph_M3500"
command: |
export PYTHONPATH=${PYTHONPATH}:$(pwd)/lib && source venv/bin/activate
cd mrobpy/tests/
python3 FGraph_M3500.py
python3 mrobpy/tests/FGraph_M3500.py
when: always
- run:
name: "Run FGraph_sphere"
command: |
export PYTHONPATH=${PYTHONPATH}:$(pwd)/lib && source venv/bin/activate
cd mrobpy/tests/
python3 FGraph_sphere.py
python3 mrobpy/tests/FGraph_sphere.py
when: always
- run:
name: "Run SE3_examples"
command: |
export PYTHONPATH=${PYTHONPATH}:$(pwd)/lib && source venv/bin/activate
python3 mrobpy/tests/SE3_examples.py
when: always
- run:
name: "Run FGraph_landmark_3d_example"
command: |
export PYTHONPATH=${PYTHONPATH}:$(pwd)/lib && source venv/bin/activate
python3 mrobpy/tests/FGraph_landmark_3d_example.py
when: always
- run:
name: "Run FGraph_landmark_2d_example"
command: |
export PYTHONPATH=${PYTHONPATH}:$(pwd)/lib && source venv/bin/activate
python3 mrobpy/tests/FGraph_landmark_2d_example.py
when: always
- run:
name: "Run PC_align"
command: |
export PYTHONPATH=${PYTHONPATH}:$(pwd)/lib && source venv/bin/activate
python3 mrobpy/tests/PC_align.py
when: always
build-wheel:
Expand Down Expand Up @@ -119,16 +102,18 @@ jobs:
${VERSION} ~/project/build/wheelhouse/*.whl
publish-pypi:
docker:
- image: circleci/python:3.8
- image: cimg/python:3.9
steps:
- attach_workspace:
at: ~/
- run:
name: Upload to PyPI
command: |
echo -e "[pypi]" >> ~/.pypirc
echo -e "username = __token__" >> ~/.pypirc
echo -e "password = $PYPI_PASSWORD" >> ~/.pypirc
cat >> ~/.pypirc \<< EOD
[pypi]
username = __token__
password = $PYPI_PASSWORD
EOD
python3 -m pip install --user --upgrade twine
twine upload ~/project/build/wheelhouse/*.whl
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ bin/
*.pdf
*.pkl

mrob/
mrob
dist/
mrob.egg-info/
11 changes: 10 additions & 1 deletion __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,16 @@
#

from mrob import mrob
fgraph = mrob.fgraph

FGraph = mrob.FGraph
GN = mrob.GN
LEVENBERG_MARQUARDT_ELLIP = mrob.LEVENBERG_MARQUARDT_ELLIP
LEVENBERG_MARQUARDT_SPHER = mrob.LEVENBERG_MARQUARDT_SPHER
LM = mrob.LM
NEWTON_RAPHSON = mrob.NEWTON_RAPHSON
geometry = mrob.geometry
optimMethod = mrob.optimMethod
ostream_redirect = mrob.ostream_redirect
registration = mrob.registration

del(mrob)
4 changes: 2 additions & 2 deletions mrobpy/tests/FGraph_M3500.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#
import mrob
import numpy as np
from os import path
import time



# Initialize data structures
vertex_ini = {}
factors = {}
factors_dictionary = {}
N = 3500

# load file
with open('../../benchmarks/M3500.txt', 'r') as file:
with open(path.join(path.dirname(__file__), '../../benchmarks/M3500.txt'), 'r') as file:
for line in file:
d = line.split()
# read edges and vertex, in TORO format
Expand Down
3 changes: 2 additions & 1 deletion mrobpy/tests/FGraph_sphere.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#
import mrob
import numpy as np
from os import path
import time

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

0 comments on commit afc9ef3

Please sign in to comment.