-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
29e98e6
commit 04590d8
Showing
11 changed files
with
177 additions
and
74 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
from typing import List, Tuple | ||
|
||
import matplotlib.pyplot as plt | ||
import numpy as np | ||
import typer | ||
from rich.console import Console | ||
|
||
from polyharmonics import spherical_harmonic | ||
|
||
console = Console() | ||
|
||
|
||
def plotsh_command( | ||
nm: str = typer.Argument( | ||
..., | ||
help="""The corresponding subscript(s) and superscript(s) of the function(s). | ||
Either a pair of integers separated by ':' or a comma-separated list of such pairs.""", # noqa: E501 | ||
metavar="SUB:SUP", | ||
), | ||
) -> None: | ||
"""Plot the spherical harmonics given by this package.""" | ||
|
||
try: | ||
n_values: List[int] = [] | ||
m_values: List[int] = [] | ||
for value in nm.split(","): | ||
n, m = value.split(":") | ||
if n is None or m is None or n == "" or m == "": | ||
raise typer.BadParameter( | ||
"nm must either be a pair of integers separated by ':' or a list of such pairs separated by commas." # noqa: E501 | ||
) | ||
else: | ||
n_values.append(int(n)) | ||
m_values.append(int(m)) | ||
if any(i < 0 for i in n_values): | ||
raise typer.BadParameter("All subscripts must be greater or equal to 0.") | ||
except ValueError: | ||
raise typer.BadParameter( | ||
"nm must either be a pair of integers separated by ':' or a list of such pairs separated by commas." # noqa: E501 | ||
) | ||
|
||
raise typer.Exit() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters