🎨 Format Python code with psf/black

This commit is contained in:
ndem0
2024-02-09 11:25:00 +00:00
committed by Nicola Demo
parent 591aeeb02b
commit cbb43a5392
64 changed files with 1323 additions and 955 deletions

View File

@@ -37,7 +37,7 @@ class Exclusion(OperationInterface):
Check if a point is inside the ``Exclusion`` domain.
:param point: Point to be checked.
:type point: torch.Tensor
:type point: torch.Tensor
:param bool check_border: If ``True``, the border is considered inside.
:return: ``True`` if the point is inside the Exclusion domain, ``False`` otherwise.
:rtype: bool
@@ -48,7 +48,7 @@ class Exclusion(OperationInterface):
flag += 1
return flag == 1
def sample(self, n, mode='random', variables='all'):
def sample(self, n, mode="random", variables="all"):
"""
Sample routine for ``Exclusion`` domain.
@@ -76,9 +76,10 @@ class Exclusion(OperationInterface):
5
"""
if mode != 'random':
if mode != "random":
raise NotImplementedError(
f'{mode} is not a valid mode for sampling.')
f"{mode} is not a valid mode for sampling."
)
sampled = []
@@ -104,4 +105,4 @@ class Exclusion(OperationInterface):
sampled_points.append(sample)
sampled += sampled_points
return LabelTensor(torch.cat(sampled), labels=self.variables)
return LabelTensor(torch.cat(sampled), labels=self.variables)