First time here? Check out the FAQ!

Ask Your Question
2

Sagemanifold - `only_nonredundant = True` by default

asked 6 years ago

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)?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
3

answered 6 years ago

rburing gravatar image

updated 6 years ago

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).

Preview: (hide)
link

Comments

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

Dox gravatar imageDox ( 6 years ago )

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: 6 years ago

Seen: 317 times

Last updated: Dec 03 '18