Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose GraphvizFormatting and test in python #1059

Merged
merged 5 commits into from
Jan 24, 2022

Conversation

senselessDev
Copy link
Contributor

This exposes the GraphvizFormatting class with direct member access as discussed in #1053. This allows to do some configuration on the saveGraph call that was not possible via the bindings before.

It also adds a few basic tests for it.

Lastly, I had the problem that the python-test target was only testing the files that were copied to the build directory before but not any new tests. Adding the dependency fixed that by always copying the tests. I don't know if that is wanted behavior.

Copy link
Member

@dellaert dellaert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome! I'll trigger CI so please wait on the results before pushing, so CI only has to run once more if any problems pop up there.

python/CMakeLists.txt Show resolved Hide resolved
python/gtsam/tests/test_GraphvizFormatting.py Outdated Show resolved Hide resolved
python/gtsam/tests/test_GraphvizFormatting.py Show resolved Hide resolved
python/gtsam/tests/test_GraphvizFormatting.py Show resolved Hide resolved
@senselessDev
Copy link
Contributor Author

senselessDev commented Jan 23, 2022

Thanks for your positive feedback!

One additional thing I just noticed: in the readme of the python directory it is written it should take CMAKE_INSTALL_PREFIX into account. But according to my observation, it does not. I think we have to add --prefix ${CMAKE_INSTALL_PREFIX} to the setup.py install line in the CMakeLists.txt.

Edit: Obviously, I can push that if you say we want that and the CI is done ;)

@dellaert
Copy link
Member

Thanks for your positive feedback!

One additional thing I just noticed: in the readme of the python directory it is written it should take CMAKE_INSTALL_PREFIX into account. But according to my observation, it does not. I think we have to add --prefix ${CMAKE_INSTALL_PREFIX} to the setup.py install line in the CMakeLists.txt.

Edit: Obviously, I can push that if you say we want that and the CI is done ;)

@varunagrawal comment?
The comment might be out of date because as far as I know, we now use the default python install locations, which I think is probably appropriate.

@senselessDev
Copy link
Contributor Author

I actually like the option to install it somewhere else. By default, it wants to install to /usr/local which requires root privileges. When you specify CMAKE_INSTALL_PREFIX to ~/.local for example, it usually is also on PATH/PYTHON_PATH and only a per-user installation which does not require root privileges.

@varunagrawal
Copy link
Collaborator

I need to check but that part of the readme may indeed be out of date.

@senselessDev
Copy link
Contributor Author

Changed copyright section and included --prefix option for setup.py. I think the second point only is beneficial and has no drawbacks.

Copy link
Member

@dellaert dellaert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, but the prefix thing has to be a different PR. We can't risk unintended consequences. Please remove from this PR, but we'd love it if you could submit as a separate PR and explain the behavior. I don;t understand well enough what it does.

python/CMakeLists.txt Outdated Show resolved Hide resolved
@dellaert dellaert merged commit f43900f into borglab:develop Jan 24, 2022
@dellaert
Copy link
Member

Thanks !!!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants