-
-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #125 from Kai-Striega/broadcast-rework/mirr
ENH: mirr: Mimic broadcasting
- Loading branch information
Showing
3 changed files
with
133 additions
and
66 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import numpy as np | ||
from hypothesis import strategies as st | ||
from hypothesis.extra import numpy as npst | ||
|
||
real_scalar_dtypes = st.one_of( | ||
npst.floating_dtypes(), | ||
npst.integer_dtypes(), | ||
npst.unsigned_integer_dtypes() | ||
) | ||
nicely_behaved_doubles = npst.from_dtype( | ||
np.dtype("f8"), | ||
allow_nan=False, | ||
allow_infinity=False, | ||
allow_subnormal=False, | ||
) | ||
cashflow_array_strategy = npst.arrays( | ||
dtype=npst.floating_dtypes(sizes=64), | ||
shape=npst.array_shapes(min_dims=1, max_dims=2, min_side=0, max_side=25), | ||
elements=nicely_behaved_doubles, | ||
) | ||
cashflow_list_strategy = cashflow_array_strategy.map(lambda x: x.tolist()) | ||
cashflow_array_like_strategy = st.one_of( | ||
cashflow_array_strategy, | ||
cashflow_list_strategy, | ||
) | ||
short_nicely_behaved_doubles = npst.arrays( | ||
dtype=npst.floating_dtypes(sizes=64), | ||
shape=npst.array_shapes(min_dims=0, max_dims=1, min_side=0, max_side=5), | ||
elements=nicely_behaved_doubles, | ||
) | ||
|
||
when_strategy = st.sampled_from( | ||
['end', 'begin', 'e', 'b', 0, 1, 'beginning', 'start', 'finish'] | ||
) |
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