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

[pre-commit.ci] pre-commit autoupdate #135

Merged
merged 2 commits into from
Nov 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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 .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ repos:


- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.982
rev: v0.990
hooks:
- id: mypy
files: cashocs/
Expand Down
9 changes: 1 addition & 8 deletions cashocs/_forms/control_form_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,7 @@ def restrict_to_inactive_set(

return b

def project_to_admissible_set(
self, a: List[fenics.Function]
) -> List[fenics.Function]:
def project_to_admissible_set(self, a: List[fenics.Function]) -> None:
"""Project a function to the set of admissible controls.

Projects a control type function ``a`` onto the set of admissible controls
Expand All @@ -339,9 +337,6 @@ def project_to_admissible_set(
a: The function which is to be projected onto the set of admissible
controls (is overwritten)

Returns:
The result of the projection (overwrites input ``a``)

"""
for j in range(self.control_dim):
if self.require_control_constraints[j]:
Expand All @@ -354,8 +349,6 @@ def project_to_admissible_set(
)
a[j].vector().apply("")

return a

def _compute_gradient_equations(self) -> None:
"""Calculates the variational form of the gradient equation."""
self.gradient_forms_rhs = [
Expand Down
4 changes: 1 addition & 3 deletions cashocs/_forms/form_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,6 @@ def update_scalar_product(self) -> None:
"""Updates the scalar product."""
pass

def project_to_admissible_set(
self, a: List[fenics.Function]
) -> List[fenics.Function]:
def project_to_admissible_set(self, a: List[fenics.Function]) -> None:
"""Projects a function ``a`` onto the admissible set."""
pass