skyportal / gwemopt

Gravitational-wave Electromagnetic Optimization
GNU General Public License v3.0
19 stars 34 forks source link

Numpy deprecation warning #155

Closed robertdstein closed 2 months ago

robertdstein commented 3 months ago

Running latest gwemopt release (v0.2.2) with latest numpy (1.26.4) and arguments:

['--telescopes', 'ZTF', '--doTiles', '--doPlots', '--doSchedule', '--timeallocationType', 'powerlaw', '--scheduleType', 'greedy', '-o', '/Users/robertstein/Data/snipergw/S190425z/ZTF/gwemopt', '--gpstime', '1240218018.0', '--event', '/Users/robertstein/Data/snipergw/skymaps/S190425z_2_LALInference.fits.gz', '--filters', 'g,r,g', '--exposuretimes', '300.0,300.0,300.0', '--doSingleExposure', '--doBalanceExposure', '--airmass', '2.5', '--mindiff', '30', '--powerlaw_cl', '0.9', '--doAlternatingFilters']

I get many warnings of the following kind:

/Users/robertstein/Code/gwemopt/gwemopt/scheduler.py:124: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
  tileexpdur[jj] = tile_struct[key]["exposureTime"]
/Users/robertstein/Code/gwemopt/gwemopt/tiles.py:61: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
  idx_keep = sort_idx[: int(max_nb_tile)]
/Users/robertstein/Code/gwemopt/gwemopt/scheduler.py:124: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)

This should probably be fixed.

mcoughlin commented 2 months ago

I think this is now fixed.