Skip to content

Commit

Permalink
Reformat .pyi files using black
Browse files Browse the repository at this point in the history
  • Loading branch information
geomorphysics committed Mar 21, 2022
1 parent aef5cc0 commit 5264a65
Show file tree
Hide file tree
Showing 32 changed files with 994 additions and 166 deletions.
13 changes: 10 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,18 @@
"python.linting.enabled": true,
"python.linting.mypyEnabled": false,
"python.linting.flake8Enabled": false,
"python.linting.pylintEnabled": true,
"python.linting.pylintEnabled": false,
"python.formatting.provider": "black",
"python.formatting.autopep8Args": ["--max-line-length=80"],
"python.formatting.autopep8Args": [
"--max-line-length=80",
"--ignore",
"E402"
],
"python.formatting.blackArgs": ["--line-length", "80"],
"python.linting.pydocstyleEnabled": true,
"python.linting.pycodestyleEnabled": false,
"python.formatting.blackPath": "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/bin/black"
"python.formatting.blackPath": "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/bin/black",
"python.linting.banditEnabled": false,
"python.linting.prospectorEnabled": false,
"python.linting.pylintArgs": ["--disable=C0103"]
}
44 changes: 34 additions & 10 deletions Notebooks/Theory/Anisotropy.ipynb

Large diffs are not rendered by default.

24 changes: 22 additions & 2 deletions Packages/gme/core/equations.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,29 @@ class EquationsBase:
beta_type: Eq
varphi_type: Eq
do_raw: Eq
def __init__(self, parameters: Optional[Dict] = ..., eta_: Rational = ..., mu_: Rational = ..., beta_type: str = ..., varphi_type: str = ..., do_raw: bool = ...) -> None: ...
def __init__(
self,
parameters: Optional[Dict] = ...,
eta_: Rational = ...,
mu_: Rational = ...,
beta_type: str = ...,
varphi_type: str = ...,
do_raw: bool = ...,
) -> None: ...

class EquationsMixedIn(EquationsBase, RpMixin, XiMixin, VarphiMixin, FundamentalMixin, HamiltonsMixin, NdimMixin, ProfileMixin, AnglesMixin, MetricTensorMixin, PxpolyMixin):
class EquationsMixedIn(
EquationsBase,
RpMixin,
XiMixin,
VarphiMixin,
FundamentalMixin,
HamiltonsMixin,
NdimMixin,
ProfileMixin,
AnglesMixin,
MetricTensorMixin,
PxpolyMixin,
):
def __init__(self, **kwargs) -> None: ...

class Equations(EquationsMixedIn):
Expand Down
8 changes: 6 additions & 2 deletions Packages/gme/core/equations_extended.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@ class EquationsIdtx(Equations, IdtxMixin):

class EquationsIbc(Equations, IbcMixin):
ibc_type: str
def __init__(self, parameters: Optional[Dict] = ..., ibc_type: str = ..., **kwargs) -> None: ...
def __init__(
self, parameters: Optional[Dict] = ..., ibc_type: str = ..., **kwargs
) -> None: ...

class EquationsIdtxIbc(EquationsIdtx, IbcMixin):
ibc_type: str
def __init__(self, parameters: Optional[Dict] = ..., ibc_type: str = ..., **kwargs) -> None: ...
def __init__(
self, parameters: Optional[Dict] = ..., ibc_type: str = ..., **kwargs
) -> None: ...

class EquationsSetupOnly(EquationsMixedIn, GeodesicMixin, IdtxMixin, IbcMixin):
ibc_type: str
Expand Down
8 changes: 7 additions & 1 deletion Packages/gme/core/equations_subset.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,10 @@ class EquationSubset:
poly_px_xiv0_eqn: Eq
xiv0_xih0_Ci_eqn: Eq
hamiltons_eqns: Eq
def __init__(self, gmeq: Type[Equations], parameters: Dict, do_ndim: bool = ..., do_revert: bool = ...) -> None: ...
def __init__(
self,
gmeq: Type[Equations],
parameters: Dict,
do_ndim: bool = ...,
do_revert: bool = ...,
) -> None: ...
4 changes: 3 additions & 1 deletion Packages/gme/core/pxpoly.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ class PxpolyMixin:
poly_px_xiv_varphi_eqn: Eq
poly_px_xiv_eqn: Eq
poly_px_xiv0_eqn: Eq
def define_px_poly_eqn(self, eta_choice: Rational = ..., do_ndim: bool = ...) -> None: ...
def define_px_poly_eqn(
self, eta_choice: Rational = ..., do_ndim: bool = ...
) -> None: ...
37 changes: 32 additions & 5 deletions Packages/gme/core/utils.pyi
Original file line number Diff line number Diff line change
@@ -1,9 +1,36 @@
from sympy import Eq, Poly, Rational, Symbol
from typing import Any, Dict, Optional, Tuple

def pxpz0_from_xiv0(parameters: Dict[str, Any], pz0_xiv0_eqn: Eq, poly_px_xiv0_eqn: Eq) -> Tuple[Any, Any]: ...
def gradient_value(x_: float, pz_: float, px_poly_eqn: Eq, do_use_newton: bool = ...) -> float: ...
def px_value_search(x_: float, pz_: float, px_poly_eqn: Eq, method: str = ..., px_guess: float = ..., px_var_: Symbol = ..., pz_var_: Symbol = ..., bracket: Tuple[float, float] = ...) -> float: ...
def px_value(x_: float, pz_: float, px_poly_eqn: Eq, px_var_: Symbol = ..., pz_var_: Symbol = ...) -> float: ...
def find_dzdx_poly_root(dzdx_poly_: Poly, xhat_: float, xivhat0_: float, guess: float = ..., eta_: Optional[Rational] = ..., method: str = ..., bracket: Tuple[float, float] = ...) -> Any: ...
def pxpz0_from_xiv0(
parameters: Dict[str, Any], pz0_xiv0_eqn: Eq, poly_px_xiv0_eqn: Eq
) -> Tuple[Any, Any]: ...
def gradient_value(
x_: float, pz_: float, px_poly_eqn: Eq, do_use_newton: bool = ...
) -> float: ...
def px_value_search(
x_: float,
pz_: float,
px_poly_eqn: Eq,
method: str = ...,
px_guess: float = ...,
px_var_: Symbol = ...,
pz_var_: Symbol = ...,
bracket: Tuple[float, float] = ...,
) -> float: ...
def px_value(
x_: float,
pz_: float,
px_poly_eqn: Eq,
px_var_: Symbol = ...,
pz_var_: Symbol = ...,
) -> float: ...
def find_dzdx_poly_root(
dzdx_poly_: Poly,
xhat_: float,
xivhat0_: float,
guess: float = ...,
eta_: Optional[Rational] = ...,
method: str = ...,
bracket: Tuple[float, float] = ...,
) -> Any: ...
def make_dzdx_poly(dzdx_Ci_polylike_eqn_: Eq, sub_: Dict) -> Poly: ...
17 changes: 14 additions & 3 deletions Packages/gme/knickpoints/base.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ class InitialProfileSolution(BaseSolution):
rz_initial_surface_eqn: Eq
ic: Tuple[float, float, float, float]
def __init__(self, gmeq: Equations, parameters: Dict, **kwargs) -> None: ...
def initial_conditions(self, x_: float) -> Tuple[float, float, float, float]: ...
def initial_conditions(
self, x_: float
) -> Tuple[float, float, float, float]: ...
def solve(self, report_pc_step: int = ...) -> None: ...

class InitialCornerSolution(BaseSolution):
Expand All @@ -25,7 +27,9 @@ class InitialCornerSolution(BaseSolution):
rdot: Matrix
ic: Tuple[float, float, float, float]
def __init__(self, gmeq: Equations, parameters: Dict, **kwargs) -> None: ...
def initial_conditions(self, beta0_) -> Tuple[float, float, float, float]: ...
def initial_conditions(
self, beta0_
) -> Tuple[float, float, float, float]: ...
def solve(self, report_pc_step: int = ..., verbose: bool = ...) -> None: ...

class CompositeSolution(BaseSolution, metaclass=abc.ABCMeta):
Expand All @@ -40,6 +44,13 @@ class CompositeSolution(BaseSolution, metaclass=abc.ABCMeta):
vbs: Any
n_rays: int
def __init__(self, gmeq: Equations, parameters: Dict, **kwargs) -> None: ...
def create_solutions(self, t_end: float = ..., t_slip_end: float = ..., do_solns: Dict = ..., n_rays: Dict = ..., n_t: Dict = ...) -> None: ...
def create_solutions(
self,
t_end: float = ...,
t_slip_end: float = ...,
do_solns: Dict = ...,
n_rays: Dict = ...,
n_t: Dict = ...,
) -> None: ...
def solve(self) -> None: ...
def merge_rays(self) -> None: ...
40 changes: 35 additions & 5 deletions Packages/gme/ode/base.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,43 @@ class BaseSolution(ABC, metaclass=abc.ABCMeta):
cx_v_lambda: Any
vx_interp_fast: Any
vx_interp_slow: Any
def __init__(self, gmeq: Equations, parameters: Dict, choice: str = ..., method: str = ..., do_dense: bool = ..., x_stop: float = ..., t_end: float = ..., t_slip_end: float = ..., t_distribn: float = ..., n_rays: int = ..., n_t: int = ..., tp_xiv0_list: Optional[List[Tuple[float, float]]] = ..., customize_t_fn: Optional[Callable] = ...): ...
def __init__(
self,
gmeq: Equations,
parameters: Dict,
choice: str = ...,
method: str = ...,
do_dense: bool = ...,
x_stop: float = ...,
t_end: float = ...,
t_slip_end: float = ...,
t_distribn: float = ...,
n_rays: int = ...,
n_t: int = ...,
tp_xiv0_list: Optional[List[Tuple[float, float]]] = ...,
customize_t_fn: Optional[Callable] = ...,
): ...
@abstractmethod
def initial_conditions(self, t_lag: float = ..., xiv_0_: float = ...) -> Tuple[float, float, float, float]: ...
def initial_conditions(
self, t_lag: float = ..., xiv_0_: float = ...
) -> Tuple[float, float, float, float]: ...
@abstractmethod
def solve(self) -> None: ...
def make_model(self) -> Callable[[float, Tuple[Any, Any, Any, Any]], np.ndarray]: ...
def postprocessing(self, spline_order: int = ..., extrapolation_mode: int = ...) -> None: ...
def resolve_isochrones(self, x_subset: int = ..., t_isochrone_max: float = ..., n_isochrones: int = ..., n_resample_pts: int = ..., tolerance: float = ..., do_eliminate_caustics: bool = ..., dont_crop_cusps: bool = ...) -> None: ...
def make_model(
self,
) -> Callable[[float, Tuple[Any, Any, Any, Any]], np.ndarray]: ...
def postprocessing(
self, spline_order: int = ..., extrapolation_mode: int = ...
) -> None: ...
def resolve_isochrones(
self,
x_subset: int = ...,
t_isochrone_max: float = ...,
n_isochrones: int = ...,
n_resample_pts: int = ...,
tolerance: float = ...,
do_eliminate_caustics: bool = ...,
dont_crop_cusps: bool = ...,
) -> None: ...
def measure_cusp_propagation(self) -> None: ...
def save(self, rpt_arrays: Dict, idx: int) -> None: ...
13 changes: 11 additions & 2 deletions Packages/gme/ode/extended.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import abc
import numpy as np
from gme.core.equations import Equations
from gme.core.equations_extended import EquationsGeodesic, EquationsIbc, EquationsIdtx
from gme.core.equations_extended import (
EquationsGeodesic,
EquationsIbc,
EquationsIdtx,
)
from gme.ode.base import BaseSolution
from typing import Any, Callable, Dict, List, Union

Expand Down Expand Up @@ -68,4 +72,9 @@ class ExtendedSolution(BaseSolution, metaclass=abc.ABCMeta):
xiv_p_interp: Callable
alpha_interp: Callable
h_interp: Callable
def __init__(self, gmeq: Union[Equations, EquationsGeodesic, EquationsIdtx, EquationsIbc], parameters: Dict, **kwargs) -> None: ...
def __init__(
self,
gmeq: Union[Equations, EquationsGeodesic, EquationsIdtx, EquationsIbc],
parameters: Dict,
**kwargs
) -> None: ...
8 changes: 6 additions & 2 deletions Packages/gme/ode/single_ray.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ class SingleRaySolution(ExtendedSolution):
xiv_v_interp: InterpolatedUnivariateSpline
uhorizontal_p_interp: InterpolatedUnivariateSpline
uhorizontal_v_interp: InterpolatedUnivariateSpline
def initial_conditions(self, t_lag: float = ..., xiv_0_: float = ...) -> Tuple[float, float, float, float]: ...
def initial_conditions(
self, t_lag: float = ..., xiv_0_: float = ...
) -> Tuple[float, float, float, float]: ...
def solve(self) -> None: ...
def postprocessing(self, spline_order: int = ..., extrapolation_mode: int = ...) -> None: ...
def postprocessing(
self, spline_order: int = ..., extrapolation_mode: int = ...
) -> None: ...
20 changes: 18 additions & 2 deletions Packages/gme/ode/solve.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
import numpy as np
from typing import Any, Callable, Dict, Tuple

def solve_ODE_system(model: Callable, method: str, do_dense: bool, ic: Tuple[float, float, float, float], t_array: np.ndarray, x_stop: float = ...) -> Any: ...
def solve_Hamiltons_equations(model: Callable, method: str, do_dense: bool, ic: Tuple[float, float, float, float], parameters: Dict, t_array: np.ndarray, x_stop: float = ..., t_lag: float = ...) -> Tuple[Any, Dict[str, np.ndarray]]: ...
def solve_ODE_system(
model: Callable,
method: str,
do_dense: bool,
ic: Tuple[float, float, float, float],
t_array: np.ndarray,
x_stop: float = ...,
) -> Any: ...
def solve_Hamiltons_equations(
model: Callable,
method: str,
do_dense: bool,
ic: Tuple[float, float, float, float],
parameters: Dict,
t_array: np.ndarray,
x_stop: float = ...,
t_lag: float = ...,
) -> Tuple[Any, Dict[str, np.ndarray]]: ...
12 changes: 10 additions & 2 deletions Packages/gme/ode/time_invariant.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,13 @@ class TimeInvariantSolution(SingleRaySolution):
beta_ts_error_interp: InterpolatedUnivariateSpline
h_x_array: np.ndarray
h_z_array: np.ndarray
def postprocessing(self, spline_order: int = ..., extrapolation_mode: int = ...) -> None: ...
def integrate_h_profile(self, n_pts: int = ..., x_max: float = ..., do_truncate: bool = ..., do_use_newton: bool = ...) -> None: ...
def postprocessing(
self, spline_order: int = ..., extrapolation_mode: int = ...
) -> None: ...
def integrate_h_profile(
self,
n_pts: int = ...,
x_max: float = ...,
do_truncate: bool = ...,
do_use_newton: bool = ...,
) -> None: ...
8 changes: 7 additions & 1 deletion Packages/gme/ode/utils.pyi
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
def report_progress(i: int, n: int, progress_was: float = ..., pc_step: float = ..., is_initial_step: bool = ...) -> float: ...
def report_progress(
i: int,
n: int,
progress_was: float = ...,
pc_step: float = ...,
is_initial_step: bool = ...,
) -> float: ...
4 changes: 3 additions & 1 deletion Packages/gme/ode/velocity_boundary.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ class VelocityBoundarySolution(ExtendedSolution):
n_rays: int
ic_list: List
ivp_solns_list: List
def initial_conditions(self, t_lag: float = ..., xiv_0_: float = ...) -> Tuple[float, float, float, float]: ...
def initial_conditions(
self, t_lag: float = ..., xiv_0_: float = ...
) -> Tuple[float, float, float, float]: ...
t_ensemble_max: float
def solve(self, report_pc_step: int = ...) -> None: ...
48 changes: 44 additions & 4 deletions Packages/gme/plot/alphabeta.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,47 @@ from gme.plot.base import Graphing
from typing import Optional, Tuple

class AlphaBeta(Graphing):
def alpha_beta(self, gmeq: Equations, name: str, alpha_array: np.ndarray, beta_array: np.ndarray, tanalpha_ext_: float, tanbeta_crit_: float, fig_size: Optional[Tuple[float, float]] = ..., dpi: Optional[int] = ...) -> None: ...
def beta_anisotropy(self, gmeq: Equations, name: str, alpha_array: np.ndarray, beta_array: np.ndarray, tanalpha_ext_: float, tanbeta_crit_: float, fig_size: Optional[Tuple[float, float]] = ..., dpi: Optional[int] = ...) -> None: ...
def alpha_anisotropy(self, gmeq: Equations, name: str, alpha_array: np.ndarray, beta_array: np.ndarray, tanalpha_ext_: float, tanbeta_crit_: float, fig_size: Optional[Tuple[float, float]] = ..., dpi: Optional[int] = ...) -> None: ...
def alpha_image(self, gmeq: Equations, name: str, alpha_array: np.ndarray, beta_array: np.ndarray, tanalpha_ext_: float, tanbeta_crit_: float, fig_size: Optional[Tuple[float, float]] = ..., dpi: Optional[int] = ...) -> None: ...
def alpha_beta(
self,
gmeq: Equations,
name: str,
alpha_array: np.ndarray,
beta_array: np.ndarray,
tanalpha_ext_: float,
tanbeta_crit_: float,
fig_size: Optional[Tuple[float, float]] = ...,
dpi: Optional[int] = ...,
) -> None: ...
def beta_anisotropy(
self,
gmeq: Equations,
name: str,
alpha_array: np.ndarray,
beta_array: np.ndarray,
tanalpha_ext_: float,
tanbeta_crit_: float,
fig_size: Optional[Tuple[float, float]] = ...,
dpi: Optional[int] = ...,
) -> None: ...
def alpha_anisotropy(
self,
gmeq: Equations,
name: str,
alpha_array: np.ndarray,
beta_array: np.ndarray,
tanalpha_ext_: float,
tanbeta_crit_: float,
fig_size: Optional[Tuple[float, float]] = ...,
dpi: Optional[int] = ...,
) -> None: ...
def alpha_image(
self,
gmeq: Equations,
name: str,
alpha_array: np.ndarray,
beta_array: np.ndarray,
tanalpha_ext_: float,
tanbeta_crit_: float,
fig_size: Optional[Tuple[float, float]] = ...,
dpi: Optional[int] = ...,
) -> None: ...
Loading

0 comments on commit 5264a65

Please sign in to comment.