Dev Update (#582)
* Fix adaptive refinement (#571) --------- Co-authored-by: Dario Coscia <93731561+dario-coscia@users.noreply.github.com> * Remove collector * Fixes * Fixes * rm unnecessary comment * fix advection (#581) * Fix tutorial .html link (#580) * fix problem data collection for v0.1 (#584) * Message Passing Module (#516) * add deep tensor network block * add interaction network block * add radial field network block * add schnet block * add equivariant network block * fix + tests + doc files * fix egnn + equivariance/invariance tests Co-authored-by: Dario Coscia <dariocos99@gmail.com> --------- Co-authored-by: giovanni <giovanni.canali98@yahoo.it> Co-authored-by: AleDinve <giuseppealessio.d@student.unisi.it> * add type checker (#527) --------- Co-authored-by: Filippo Olivo <filippo@filippoolivo.com> Co-authored-by: Giovanni Canali <115086358+GiovanniCanali@users.noreply.github.com> Co-authored-by: giovanni <giovanni.canali98@yahoo.it> Co-authored-by: AleDinve <giuseppealessio.d@student.unisi.it>
This commit is contained in:
@@ -193,3 +193,22 @@ def chebyshev_roots(n):
|
||||
k = torch.arange(n)
|
||||
nodes = torch.sort(torch.cos(pi * (k + 0.5) / n))[0]
|
||||
return nodes
|
||||
|
||||
|
||||
def check_positive_integer(value, strict=True):
|
||||
"""
|
||||
Check if the value is a positive integer.
|
||||
|
||||
:param int value: The value to check.
|
||||
:param bool strict: If True, the value must be strictly positive.
|
||||
Default is True.
|
||||
:raises AssertionError: If the value is not a positive integer.
|
||||
"""
|
||||
if strict:
|
||||
assert (
|
||||
isinstance(value, int) and value > 0
|
||||
), f"Expected a strictly positive integer, got {value}."
|
||||
else:
|
||||
assert (
|
||||
isinstance(value, int) and value >= 0
|
||||
), f"Expected a non-negative integer, got {value}."
|
||||
|
||||
Reference in New Issue
Block a user