Ask Your Question
2

Sagemanifold - `only_nonredundant = True` by default

asked 2018-12-03 11:37:06 -0600

Dox gravatar image

Hi, I find the option only_nonredundant=True really helpful, but it is annoying to type over and over the option on the notebook. Is it possible to define the option globally (within a notebook)?

edit retag flag offensive close merge delete

1 answer

Sort by ┬╗ oldest newest most voted
3

answered 2018-12-03 12:05:20 -0600

updated 2018-12-03 12:05:42 -0600

That would be nice to have as an option indeed. As a workaround, you could define something like

nrcomps = lambda t, **kwargs: t.display_comp(only_nonredundant=True, **kwargs)

so you can do nrcomps(Ric) but also pass extra arguments like nrcomps(Ric, only_nonzero=True).

edit flag offensive delete link more

Comments

Excellent! Thank you for the answer, and a wonderful use of the lambda function!

Dox gravatar imageDox ( 2018-12-03 12:18:05 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-12-03 11:37:06 -0600

Seen: 30 times

Last updated: Dec 03