Skip to content

Commit

Permalink
update fast_kde_2d benchmark and changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
nitishp25 committed Apr 12, 2020
1 parent a1a0f27 commit e5414b5
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .azure-pipelines/azure-pipelines-external.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ jobs:
displayName: 'pydocstyle'
- script: |
python -m black --check arviz examples
python -m black --check arviz examples asv_benchmarks
displayName: 'black'
- task: PublishTestResults@2
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* Fixed `TypeError` in `transform` argument of `plot_density` and `plot_forest` when `InferenceData` is a list or tuple (#1121)
* Fixed overlaid pairplots issue (#1135)
* Update Docker building steps (#1127)
* Updated benchmarks and moved to asv_benchmarks/benchmarks (#1142)
* Moved `_fast_kde`, `_fast_kde_2d`, `get_bins` and `_sturges_formula` to `numeric_utils` and `get_coords` to `utils` (#1142)
### Deprecation

### Documentation
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ tools:

```bash
$ pip install black
$ black arviz/ examples/
$ black arviz/ examples/ asv_benchmarks/
```

* Your code passes pylint
Expand Down
20 changes: 11 additions & 9 deletions asv_benchmarks/benchmarks/benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def setup(self, numba_flag):
else:
az.Numba.disable_numba()

def time_variance(self, numba_flag):
def time_variance_2d(self, numba_flag):
stats_variance_2d(self.data)


Expand All @@ -54,11 +54,11 @@ def time_circ_std(self, numba_flag):


class Fast_Kde_1d:
params = [(True, False), (10**5, 10**6, 10**7)]
params = [(True, False), (10 ** 5, 10 ** 6, 10 ** 7)]
param_names = ("Numba", "n")

def setup(self, numba_flag, n):
self.x = np.random.randn(n//10, 10)
self.x = np.random.randn(n // 10, 10)
if numba_flag:
az.Numba.enable_numba()
else:
Expand All @@ -67,21 +67,23 @@ def setup(self, numba_flag, n):
def time_fast_kde_normal(self, numba_flag, n):
_fast_kde(self.x)


class Fast_KDE_2d:
params = [(True, False), (10**5, 10**6)]
param_names = ("Numba", "n")
params = [(True, False), ((100, 10 ** 4), (10 ** 4, 100), (1000, 1000))]
param_names = ("Numba", "shape")

def setup(self, numba_flag, n):
self.x = np.random.randn(n//10, 10)
self.y = np.random.randn(n//10, 10)
def setup(self, numba_flag, shape):
self.x = np.random.randn(*shape)
self.y = np.random.randn(*shape)
if numba_flag:
az.Numba.enable_numba()
else:
az.Numba.disable_numba()

def time_fast_kde_2d(self, numba_flag, n):
def time_fast_kde_2d(self, numba_flag, shape):
_fast_kde_2d(self.x, self.y)


class Atleast_Nd:
params = ("az.utils", "numpy")
param_names = ("source",)
Expand Down
4 changes: 4 additions & 0 deletions scripts/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ python -m pydocstyle --convention=numpy ${SRC_DIR}/arviz/
echo "Success!"

echo "Checking code style with black..."
<<<<<<< HEAD
python -m black -l 100 --check ${SRC_DIR}/arviz/ ${SRC_DIR}/examples/
=======
python -m black -l 100 --check ${SRC_DIR}/arviz/ ${SRC_DIR}/examples/ ${SRC_DIR}/asv_benchmarks/
>>>>>>> update fast_kde_2d benchmark and changelog
echo "Success!"

echo "Checking code style with pylint..."
Expand Down

0 comments on commit e5414b5

Please # to comment.