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

Added to_table method to OptionsDictionary to provide embed_options replacement capability in Jupyter. #1924

Merged
merged 2 commits into from
Mar 2, 2021

Conversation

robfalck
Copy link
Contributor

@robfalck robfalck commented Feb 26, 2021

Summary

OptionsDictionary now has a new method to_table() which can output a table representation using the tabulate package.
The __rst__() method now uses tabulate to build the underlying restructured text.
Tests for repr changed because tabulate includes two spaces between columns instead of one.

Related Issues

None

Backwards incompatibilities

None

New Dependencies

tabulate is now used when building the Sphinx documentation.
It is included when pip installed with [notebooks] or [all].

…table representation using the tabulate package.

The __rst__() method now uses tabulate to build the underlying restructured text.
Tests for repr changed because tabulate includes two spaces between columns instead of one.
@robfalck robfalck requested a review from swryan February 26, 2021 11:58
]))

def test_to_table(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we need a skipTest on this in case tabulate is not installed... and/or a test for the "tabulate not installed" message...

except ImportError as e:
msg = "'to_table' requires the tabulate package but it is not currently installed." \
" Use `pip install tablulate` or install openmdao with" \
" `pip install openmdao[notebooks]`."
Copy link
Contributor

Choose a reason for hiding this comment

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

tabulate should probably be added to the docs optional dependencies, since it is now required to build the docs

@swryan swryan merged commit 87e6404 into OpenMDAO:master Mar 2, 2021
@robfalck robfalck deleted the options_dict_to_table branch April 7, 2023 13:48
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