diff --git a/cython/README.md b/cython/README.md index e1540471a..95eea7ff6 100644 --- a/cython/README.md +++ b/cython/README.md @@ -5,15 +5,17 @@ INSTALL - This wrapper needs Cython(>=0.25), numpy and eigency, which can be installed as follows: ->> cd /cython ->> pip install -r requirements.txt ->> pip install eigency +```bash + cd /cython + pip install -r requirements.txt + pip install eigency +``` Note: Currently there's some issue with including eigency in requirements.txt -- Build and install gtsam using cmake with GTSAM\_INSTALL\_CYTHON_TOOLBOX enabled +- Build and install gtsam using cmake with GTSAM_INSTALL_CYTHON_TOOLBOX enabled Note: By default, the wrapped module will be installed in -/gtsam\_cython. Change that in GTSAM\_CYTHON\_TOOLBOX\_PATH +/gtsam_cython. Change that in GTSAM_CYTHON_TOOLBOX_PATH UNIT TESTS @@ -21,9 +23,10 @@ UNIT TESTS The Cython toolbox also has a small set of unit tests located in the test directory. To run them: ->> cd /Users/yourname/gtsam_cython # Change to wherever you installed the toolbox ->> python -m unittest discover - +```bash + cd /Users/yourname/gtsam_cython # Change to wherever you installed the toolbox + python -m unittest discover +``` WRITING YOUR OWN SCRIPTS ======================== @@ -33,13 +36,13 @@ See the tests for examples. - Vector/Matrix: Due to a design choice of eigency, numpy.array matrices with the default order='A' will always be transposed in C++ no matter how you transpose it in Python. Use order='F', or use -two functions Vector and Matrix in gtsam\_utils/np\_utils.py for your conveniences. These two functions +two functions Vector and Matrix in gtsam_utils/np_utils.py for your conveniences. These two functions also help to avoid a common but very subtle bug of using integers when creating numpy arrays, e.g. np.array([1,2,3]). These can't be an input for gtsam functions as they only accept floating-point arrays. For more details, see: https://github.com/wouterboomsma/eigency#storage-layout---why-arrays-are-sometimes-transposed - Inner namespace: Classes in inner namespace will be prefixed by _ in Python. -Examples: noiseModel\_Gaussian, noiseModeli\_mEstimator\_Tukey +Examples: noiseModel_Gaussian, noiseModel_mEstimator_Tukey - Use keyword arguments to differentiate overloads with the same number of arguments. This applies for all constructors, methods and static methods. @@ -52,8 +55,10 @@ Examples: values.insertPose3(1, Pose3()), values.insertRot3(2, Rot3()), values.i - Casting from a base class to a derive class must be done explicitly. Examples: - noiseBase = factor.get\_noiseModel() - noiseGaussian = dynamic\_cast\_noiseModel\_Gaussian\_noiseModel\_Base(noiseBase) +```Python + noiseBase = factor.get_noiseModel() + noiseGaussian = dynamic_cast_noiseModel_Gaussian_noiseModel_Base(noiseBase) +``` diff --git a/cython/install.sh b/cython/install.sh deleted file mode 100755 index 987a25d06..000000000 --- a/cython/install.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash - -virtualenv venv -source venv/bin/activate -pip install -r requirements.txt -pip install eigency \ No newline at end of file