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

[parameters/functionals] Add LincombParameterFunctional #950

Merged
merged 8 commits into from Jun 16, 2020

Conversation

TiKeil
Copy link
Contributor

@TiKeil TiKeil commented Jun 11, 2020

This PR implements a LincombParameterFunctional.
Moreover this enables to use + and - operators for ParameterFunctional. Moreover, it is now possible to multiply ParameterFunctional by numbers.

Also, a small test is added to a new file. (Didn't we have a test file for parameters/functionals.py yet?)

This PR is of much interest for the product rule in #934

@codecov
Copy link

@codecov codecov bot commented Jun 11, 2020

Codecov Report

Merging #950 into master will increase coverage by 0.02%.
The diff coverage is 89.28%.

Impacted Files Coverage Δ
src/pymor/parameters/functionals.py 93.29% <89.28%> (-0.72%) ⬇️

Copy link
Member

@sdrave sdrave left a comment

LGTM, apart from a few minor things.

src/pymor/parameters/functionals.py Outdated Show resolved Hide resolved
src/pymor/parameters/functionals.py Show resolved Hide resolved

def d_mu(self, parameter, index=0):
functionals_d_mu = [f.d_mu(parameter, index) for f in self.functionals]
return self.with_(functionals=functionals_d_mu, name=self.name + '_d_mu')
Copy link
Member

@sdrave sdrave Jun 15, 2020

Choose a reason for hiding this comment

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

This would probably need to be adapted elsewhere (in a different PR), but maybe name=f'{self.name}_d_{parameter}_{index}' would be more helpful?

Copy link
Contributor Author

@TiKeil TiKeil Jun 15, 2020

Choose a reason for hiding this comment

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

Very good point !

src/pymor/parameters/functionals.py Outdated Show resolved Hide resolved
src/pymor/parameters/functionals.py Outdated Show resolved Hide resolved
@sdrave sdrave added this to the 2020.1 milestone Jun 15, 2020
@sdrave sdrave added generic-objects pr:new-feature labels Jun 15, 2020
@TiKeil
Copy link
Contributor Author

@TiKeil TiKeil commented Jun 15, 2020

I addressed your points. I will put name=f'{self.name}_d_{parameter}_{index} in another PR then

@TiKeil TiKeil force-pushed the add_lincomb_parameter_functional branch from 8ec5213 to afb42ce Compare Jun 15, 2020
sdrave
sdrave approved these changes Jun 15, 2020
@sdrave sdrave merged commit e16d3b0 into pymor:master Jun 16, 2020
9 checks passed
@TiKeil TiKeil deleted the add_lincomb_parameter_functional branch Jun 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:new-feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants