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

Docstring incorrect with_subdomains #1134

Closed
kinnala opened this issue Jun 15, 2024 · 0 comments · Fixed by #1133
Closed

Docstring incorrect with_subdomains #1134

kinnala opened this issue Jun 15, 2024 · 0 comments · Fixed by #1133

Comments

@kinnala
Copy link
Owner

kinnala commented Jun 15, 2024

Hi, everyone) I don't want to set up a separate topic, so I'll leave a couple of sentences about Mesh.with_subdomains.

The current signature is:

def with_subdomains(self, subdomains: Dict[str, Callable[[ndarray], ndarray]]):
"""Return a copy of the mesh with named subdomains.

        Parameters
        ----------
        boundaries
            A dictionary of lambda functions with the names of the subdomains
            as keys.  The midpoint of the element should return ``True`` for
            the corresponding lambda function if the element belongs to the
            subdomain.

        """
        return replace(
            self,
            _subdomains={
                **({} if self._subdomains is None else self._subdomains),
                **{name: (self.elements_satisfying(test)
                          if callable(test) else test)
                   for name, test in subdomains.items()},
            },
        )
  1. In the docstring, 'boundaries' should be replaced with 'subdomains'.
  2. This function is similar to with_boundaries, so:
    2.1 Perhaps the following signature should be defined:
def with_subdomains(self, subdomains: Dict[str, Union[Callable[[ndarray], ndarray],  ndarray]]):

2.2 Make changes to the Parameters description:
"
Parameters
----------
subdomains
A dictionary of index arrays or lambda functions with the names of the subdomains
as keys.
"

Originally posted by @valvikby in #1093 (reply in thread)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant