wavespectra 4.0.0__tar.gz → 4.0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. {wavespectra-4.0.0/wavespectra.egg-info → wavespectra-4.0.2}/PKG-INFO +3 -3
  2. {wavespectra-4.0.0 → wavespectra-4.0.2}/README.rst +2 -2
  3. {wavespectra-4.0.0 → wavespectra-4.0.2}/pyproject.toml +1 -1
  4. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/__init__.py +1 -1
  5. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/partition/specpart/specpartc.c +51 -37
  6. wavespectra-4.0.2/wavespectra/partition/specpart/specpartc.h +5 -0
  7. {wavespectra-4.0.0 → wavespectra-4.0.2/wavespectra.egg-info}/PKG-INFO +3 -3
  8. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra.egg-info/SOURCES.txt +1 -0
  9. {wavespectra-4.0.0 → wavespectra-4.0.2}/AUTHORS.rst +0 -0
  10. {wavespectra-4.0.0 → wavespectra-4.0.2}/LICENSE.txt +0 -0
  11. {wavespectra-4.0.0 → wavespectra-4.0.2}/setup.cfg +0 -0
  12. {wavespectra-4.0.0 → wavespectra-4.0.2}/setup.py +0 -0
  13. {wavespectra-4.0.0 → wavespectra-4.0.2}/tests/test_cli.py +0 -0
  14. {wavespectra-4.0.0 → wavespectra-4.0.2}/tests/test_cookiecutter_template.py +0 -0
  15. {wavespectra-4.0.0 → wavespectra-4.0.2}/tests/test_partition.py +0 -0
  16. {wavespectra-4.0.0 → wavespectra-4.0.2}/tests/test_specarray.py +0 -0
  17. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/cli.py +0 -0
  18. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/construct/__init__.py +0 -0
  19. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/construct/direction.py +0 -0
  20. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/construct/frequency.py +0 -0
  21. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/core/__init__.py +0 -0
  22. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/core/attributes.py +0 -0
  23. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/core/attributes.yml +0 -0
  24. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/core/fitting.py +0 -0
  25. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/core/npstats.py +0 -0
  26. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/core/select.py +0 -0
  27. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/core/swan.py +0 -0
  28. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/core/utils.py +0 -0
  29. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/core/xrstats.py +0 -0
  30. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/input/__init__.py +0 -0
  31. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/input/dataset.py +0 -0
  32. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/input/era5.py +0 -0
  33. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/input/funwave.py +0 -0
  34. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/input/json.py +0 -0
  35. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/input/ncswan.py +0 -0
  36. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/input/ndbc.py +0 -0
  37. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/input/ndbc_ascii.py +0 -0
  38. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/input/netcdf.py +0 -0
  39. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/input/obscape.py +0 -0
  40. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/input/octopus.py +0 -0
  41. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/input/spotter.py +0 -0
  42. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/input/swan.py +0 -0
  43. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/input/triaxys.py +0 -0
  44. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/input/wavespectra.py +0 -0
  45. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/input/ww3.py +0 -0
  46. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/input/ww3_station.py +0 -0
  47. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/input/wwm.py +0 -0
  48. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/input/xwaves.py +0 -0
  49. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/output/__init__.py +0 -0
  50. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/output/funwave.py +0 -0
  51. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/output/json.py +0 -0
  52. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/output/netcdf.py +0 -0
  53. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/output/octopus.py +0 -0
  54. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/output/orcaflex.py +0 -0
  55. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/output/swan.py +0 -0
  56. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/output/ww3.py +0 -0
  57. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/output/ww3.yml +0 -0
  58. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/partition/__init__.py +0 -0
  59. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/partition/hanson_and_phillips_2001.py +0 -0
  60. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/partition/partition.py +0 -0
  61. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/partition/specpart/specpartc_wrap.c +0 -0
  62. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/partition/tracking.py +0 -0
  63. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/plot.py +0 -0
  64. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/specarray.py +0 -0
  65. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra/specdataset.py +0 -0
  66. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra.egg-info/dependency_links.txt +0 -0
  67. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra.egg-info/entry_points.txt +0 -0
  68. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra.egg-info/requires.txt +0 -0
  69. {wavespectra-4.0.0 → wavespectra-4.0.2}/wavespectra.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wavespectra
3
- Version: 4.0.0
3
+ Version: 4.0.2
4
4
  Summary: Library for ocean wave spectra
5
5
  Author-email: Wavespectra Developers <r.guedes@oceanum.science>
6
6
  Maintainer-email: Rafael Guedes <r.guedes@oceanum.science>, Tom Durrant <t.durrant@oceanum.science>
@@ -86,8 +86,8 @@ Python library for ocean wave spectra.
86
86
  .. image:: https://img.shields.io/github/actions/workflow/status/wavespectra/wavespectra/python-publish.yml
87
87
  :target: https://github.com/wavespectra/wavespectra/actions
88
88
  :alt: GitHub Workflow Status (with event)
89
- .. image:: https://coveralls.io/repos/github/wavespectra/wavespectra/badge.svg
90
- :target: https://coveralls.io/github/wavespectra/wavespectra
89
+ .. image:: https://coveralls.io/repos/github/wavespectra/wavespectra/badge.svg?branch=master
90
+ :target: https://coveralls.io/github/wavespectra/wavespectra?branch=master
91
91
  .. image:: https://readthedocs.org/projects/wavespectra/badge/?version=latest
92
92
  :target: https://wavespectra.readthedocs.io/en/latest/
93
93
  .. image:: https://img.shields.io/pypi/v/wavespectra.svg
@@ -7,8 +7,8 @@ Python library for ocean wave spectra.
7
7
  .. image:: https://img.shields.io/github/actions/workflow/status/wavespectra/wavespectra/python-publish.yml
8
8
  :target: https://github.com/wavespectra/wavespectra/actions
9
9
  :alt: GitHub Workflow Status (with event)
10
- .. image:: https://coveralls.io/repos/github/wavespectra/wavespectra/badge.svg
11
- :target: https://coveralls.io/github/wavespectra/wavespectra
10
+ .. image:: https://coveralls.io/repos/github/wavespectra/wavespectra/badge.svg?branch=master
11
+ :target: https://coveralls.io/github/wavespectra/wavespectra?branch=master
12
12
  .. image:: https://readthedocs.org/projects/wavespectra/badge/?version=latest
13
13
  :target: https://wavespectra.readthedocs.io/en/latest/
14
14
  .. image:: https://img.shields.io/pypi/v/wavespectra.svg
@@ -97,7 +97,7 @@ docs = [
97
97
  [tool.setuptools.package-data]
98
98
  "wavespectra.core" = ["*.yml"]
99
99
  "wavespectra.output" = ["*.yml"]
100
- "wavespectra.specpartc" = ["specpartc.c", "specpartc.h", "specpartc_wrap.c"]
100
+ "wavespectra.partition.specpart" = ["specpartc.c", "specpartc.h", "specpartc_wrap.c"]
101
101
 
102
102
  [tool.setuptools.dynamic]
103
103
  version = {attr = "wavespectra.__version__"}
@@ -13,7 +13,7 @@ except ImportError:
13
13
  warnings.warn("Cannot import accessors at the main module level")
14
14
 
15
15
 
16
- __version__ = "4.0.0"
16
+ __version__ = "4.0.2"
17
17
 
18
18
 
19
19
  def _import_functions(pkgname="input", prefix="read"):
@@ -121,7 +121,10 @@ void partition(float * spec,
121
121
 
122
122
 
123
123
  void ptsort(int iihmax, int nnspec) {
124
- int i, in, iv, numv[iihmax], iaddr[iihmax], iorder[nnspec];
124
+ int i, in, iv;
125
+ int * numv = malloc(iihmax*sizeof(int));
126
+ int * iaddr = malloc(iihmax*sizeof(int));
127
+ int * iorder = malloc(nnspec*sizeof(int));
125
128
  /*--------------------------------
126
129
  * 1. counting occurences per height bins
127
130
  *-------------------------------*/
@@ -155,7 +158,10 @@ void ptsort(int iihmax, int nnspec) {
155
158
  *----------------------------------*/
156
159
  for (i = 0; i < nnspec; i++) {
157
160
  ind[iorder[i]] = i;
158
- }
161
+ }
162
+ free(numv);
163
+ free(iaddr);
164
+ free(iorder);
159
165
  }
160
166
 
161
167
  void ptnghb() {
@@ -272,39 +278,45 @@ int int_minval(int * data, int size) {
272
278
  }
273
279
 
274
280
 
281
+ int fifo_add(int * iq,
282
+ int iq_end,
283
+ int iv) {
284
+ *(iq + iq_end) = iv;
285
+ if ( iq_end > nspec-2 )
286
+ return 0;
287
+ return iq_end+1;
288
+ }
289
+
290
+ int fifo_empty(int iq_start,
291
+ int iq_end) {
292
+ if (iq_start != iq_end)
293
+ return 0;
294
+ return 1;
295
+ }
296
+
297
+ int fifo_first(int * iq,
298
+ int * iq_start) {
299
+ int iv = *(iq+*iq_start);
300
+ *iq_start = *iq_start+1;
301
+ if ( *iq_start > nspec -1 )
302
+ *iq_start = 0;
303
+ return iv;
304
+ }
305
+
275
306
  void pt_fld(int *imi,
276
307
  int *ind,
277
308
  int *imo,
278
309
  float *zp,
279
310
  int ihmax) {
280
311
 
281
- int mask, init, iwshed, imd[nspec];
312
+ int mask, init, iwshed;
282
313
  int ic_label, ifict_pixel, m, ih, msave;
283
314
  int ip, i, ipp, ic_dist, iempty, ippp;
284
315
  int jl, jn, ipt, j;
285
- int iq[nspec], iq_start, iq_end;
316
+ int iq_start, iq_end;
286
317
  float zpmax, ep1, diff;
287
-
288
- void fifo_add(int iv) {
289
- iq[iq_end] = iv;
290
- iq_end++;
291
- if ( iq_end > nspec-1 )
292
- iq_end = 0;
293
- }
294
-
295
- int fifo_empty() {
296
- if (iq_start != iq_end)
297
- return 0;
298
- return 1;
299
- }
300
-
301
- int fifo_first() {
302
- int iv = iq[iq_start];
303
- iq_start++;
304
- if ( iq_start > nspec -1 )
305
- iq_start = 0;
306
- return iv;
307
- }
318
+ int * iq = malloc(nspec*sizeof(int));
319
+ int * imd = malloc(nspec*sizeof(int));
308
320
 
309
321
  // 0. initializations
310
322
  mask = -2;
@@ -349,7 +361,7 @@ void pt_fld(int *imi,
349
361
  ipp = neigh[i+9*ip];
350
362
  if ( imo[ipp] > 0 || imo[ipp] == iwshed ) {
351
363
  imd[ip] = 1;
352
- fifo_add (ip); // l305
364
+ iq_end = fifo_add (iq, iq_end, ip); // l305
353
365
  break;
354
366
  }
355
367
  }
@@ -366,17 +378,17 @@ void pt_fld(int *imi,
366
378
  // 1.b process the queue
367
379
  ic_dist = 1;
368
380
  // Mark end of fifo
369
- fifo_add(ifict_pixel);
381
+ iq_end = fifo_add(iq, iq_end, ifict_pixel);
370
382
  for (;;) {
371
- ip = fifo_first();
383
+ ip = fifo_first(iq, &iq_start);
372
384
  // Check for end of processing
373
385
  if ( ip == ifict_pixel ) {
374
- if (fifo_empty())
386
+ if (fifo_empty(iq_start, iq_end))
375
387
  break;
376
388
  else {
377
- fifo_add(ifict_pixel);
389
+ iq_end = fifo_add(iq, iq_end, ifict_pixel);
378
390
  ic_dist++;
379
- ip = fifo_first();
391
+ ip = fifo_first(iq, &iq_start);
380
392
  }
381
393
  }
382
394
  // Process queue
@@ -395,7 +407,7 @@ void pt_fld(int *imi,
395
407
  }
396
408
  else if ( ( imo[ipp] == mask ) && (imd[ipp] == 0) ) {
397
409
  imd[ipp] = ic_dist +1;
398
- fifo_add(ipp);
410
+ iq_end = fifo_add(iq, iq_end, ipp);
399
411
  }
400
412
 
401
413
  }
@@ -413,18 +425,18 @@ void pt_fld(int *imi,
413
425
  if ( imo[ip] == mask ) {
414
426
  // ... New label for pixel
415
427
  ic_label++;
416
- fifo_add(ip);
428
+ iq_end = fifo_add(iq, iq_end, ip);
417
429
  imo[ip] = ic_label;
418
430
  // ... and all connected to it ...
419
431
  for (;;) {
420
- if ( fifo_empty() )
432
+ if ( fifo_empty(iq_start, iq_end) )
421
433
  break;
422
- ipp = fifo_first();
434
+ ipp = fifo_first(iq, &iq_start);
423
435
 
424
436
  for ( i = 0; i < neigh[8+9*ipp]; i++ ) {
425
437
  ippp = neigh[i+9*ipp];
426
438
  if ( imo[ippp] == mask ) {
427
- fifo_add(ippp);
439
+ iq_end = fifo_add(iq, iq_end, ippp);
428
440
  imo[ippp] = ic_label;
429
441
  }
430
442
  }
@@ -471,5 +483,7 @@ void pt_fld(int *imi,
471
483
  }
472
484
  }
473
485
 
474
- npart = ic_label;
486
+ npart = ic_label;
487
+ free(iq);
488
+ free(imd);
475
489
  }
@@ -0,0 +1,5 @@
1
+ void partition(float * spec,
2
+ int *ipart,
3
+ int nk,
4
+ int nth,
5
+ int ihmax);
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wavespectra
3
- Version: 4.0.0
3
+ Version: 4.0.2
4
4
  Summary: Library for ocean wave spectra
5
5
  Author-email: Wavespectra Developers <r.guedes@oceanum.science>
6
6
  Maintainer-email: Rafael Guedes <r.guedes@oceanum.science>, Tom Durrant <t.durrant@oceanum.science>
@@ -86,8 +86,8 @@ Python library for ocean wave spectra.
86
86
  .. image:: https://img.shields.io/github/actions/workflow/status/wavespectra/wavespectra/python-publish.yml
87
87
  :target: https://github.com/wavespectra/wavespectra/actions
88
88
  :alt: GitHub Workflow Status (with event)
89
- .. image:: https://coveralls.io/repos/github/wavespectra/wavespectra/badge.svg
90
- :target: https://coveralls.io/github/wavespectra/wavespectra
89
+ .. image:: https://coveralls.io/repos/github/wavespectra/wavespectra/badge.svg?branch=master
90
+ :target: https://coveralls.io/github/wavespectra/wavespectra?branch=master
91
91
  .. image:: https://readthedocs.org/projects/wavespectra/badge/?version=latest
92
92
  :target: https://wavespectra.readthedocs.io/en/latest/
93
93
  .. image:: https://img.shields.io/pypi/v/wavespectra.svg
@@ -64,4 +64,5 @@ wavespectra/partition/hanson_and_phillips_2001.py
64
64
  wavespectra/partition/partition.py
65
65
  wavespectra/partition/tracking.py
66
66
  wavespectra/partition/specpart/specpartc.c
67
+ wavespectra/partition/specpart/specpartc.h
67
68
  wavespectra/partition/specpart/specpartc_wrap.c
File without changes
File without changes
File without changes
File without changes