From d02693cd66a70903cc2c22e47cfe1869a1684cff Mon Sep 17 00:00:00 2001 From: Javier Vegas-Regidor Date: Tue, 14 Apr 2020 11:00:01 +0200 Subject: [PATCH 1/4] Add LICENSE --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..9f58722 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Earth Sciences + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. -- GitLab From 166a0d232b13fce8f0f289866079ce4aebd7435e Mon Sep 17 00:00:00 2001 From: Javier Vegas-Regidor Date: Wed, 15 Apr 2020 09:34:26 +0200 Subject: [PATCH 2/4] Remove reverse --- diagonals/moc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/diagonals/moc.py b/diagonals/moc.py index e8c3c95..d597cb1 100644 --- a/diagonals/moc.py +++ b/diagonals/moc.py @@ -41,7 +41,7 @@ def compute(basins, e1v, e3v, vo): if diagonals.CONFIG.use_gpu: moc = _compute_moc_gpu( vo, area - ) + ) else: moc = _compute_moc_cpu( vo, area @@ -180,7 +180,7 @@ def _vertical_cumsum(moc, out): moc: float32 Masked array containing the moc index for a given basin. """ - for lev in reversed(range(moc.shape[1]-1)): + for lev in range(moc.shape[1] - 2, -1, .1): moc[:, lev, :] = moc[:, lev, :] + moc[:, lev+1, :] -- GitLab From 7706d88aa703f4732c4a78dfc025b6606f25e806 Mon Sep 17 00:00:00 2001 From: Javier Vegas-Regidor Date: Wed, 15 Apr 2020 09:34:45 +0200 Subject: [PATCH 3/4] Bump version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 7efa253..e2bae3e 100644 --- a/setup.py +++ b/setup.py @@ -36,7 +36,7 @@ REQUIREMENTS = { setup(name='diagonals', - version='0.2.0', + version='0.2.1', description='Compute diagnostics targeting the CPU or the GPU', url='https://earth.bsc.es/gitlab/es/diagonals', author='BSC-CNS Earth Sciences Department', -- GitLab From 3129ccd99e08270e7b08adfa4426a252a4af3483 Mon Sep 17 00:00:00 2001 From: Javier Vegas-Regidor Date: Wed, 15 Apr 2020 11:35:14 +0200 Subject: [PATCH 4/4] Fix moc bug --- diagonals/moc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/diagonals/moc.py b/diagonals/moc.py index d597cb1..211d62e 100644 --- a/diagonals/moc.py +++ b/diagonals/moc.py @@ -180,7 +180,7 @@ def _vertical_cumsum(moc, out): moc: float32 Masked array containing the moc index for a given basin. """ - for lev in range(moc.shape[1] - 2, -1, .1): + for lev in range(moc.shape[1] - 2, -1, -1): moc[:, lev, :] = moc[:, lev, :] + moc[:, lev+1, :] -- GitLab