Skip to content

WIP real-valued functional #1333

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

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion odl/ufunc_ops/ufunc_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ def __init__(self, field):
"".format(name))

linear = name in LINEAR_UFUNCS
Functional.__init__(self, space=field, linear=linear)
Functional.__init__(self, domain=field, linear=linear)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why is there an explicit keyword passed in here for space/domain?
I have absolutely no experience with unit testing, so someone else needs to write the tests...

Copy link
Member

Choose a reason for hiding this comment

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

It's just for clarity.

If you write Functional.__init__(domain, range, linear) it's obvious what each of the arguments does, and keywords just add noise: Functional.__init__(domain=domain, range=range, linear=linear).
On the other hand, something like Functional.__init__(field, True) doesn't convey any information about the purpose of the arguments, so here Functional.__init__(domain=field, linear=True) is much clearer.

But why is this related to tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I stumbled across it in the test results and wanted to make sure that someone else takes over when I am done with implementing most of the stuff


def _call(self, x):
"""Return ``self(x)``."""
Expand Down