Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated np.int and np.float dependencies #797

Merged
merged 5 commits into from Oct 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/run_mtl_loop
Expand Up @@ -8,7 +8,7 @@ log = get_logger()
survey = "main"

from argparse import ArgumentParser
ap = ArgumentParser(description='Make an initial HEALPixel-split ledger for a Merged Target List based on a directory of targets')
ap = ArgumentParser(description='Update ledgers for the Merged Target based on new spectroscopic observations')
ap.add_argument("obscon",
help="String matching ONE obscondition in the bitmask yaml file \
(e.g. 'BRIGHT'). Controls priorities when merging targets, \
Expand Down
2 changes: 2 additions & 0 deletions doc/changes.rst
Expand Up @@ -5,9 +5,11 @@ desitarget Change Log
2.5.1 (unreleased)
------------------

* Address deprecated np.int and np.float dependencies [`PR #797`_]
* Functionality to download and reformat files for Gaia DR3 [`PR #796`_]

.. _`PR #796`: https://github.com/desihub/desitarget/pull/796
.. _`PR #797`: https://github.com/desihub/desitarget/pull/797

2.5.0 (2022-04-22)
------------------
Expand Down
2 changes: 1 addition & 1 deletion py/desitarget/cuts.py
Expand Up @@ -2201,7 +2201,7 @@ def _prepare_gaia(objects, colnames=None):
Grr = gaiagmag - 22.5 + 2.5*np.log10(1e-16)
ii = objects['FLUX_R'] > 0
# ADM catch the case where Grr is a scalar.
if isinstance(Grr, np.float):
if isinstance(Grr, float):
if ii:
Grr = gaiagmag - 22.5 + 2.5*np.log10(objects['FLUX_R'])
else:
Expand Down
2 changes: 1 addition & 1 deletion py/desitarget/mock/build.py
Expand Up @@ -394,7 +394,7 @@ def density_fluctuations(data, log, nside, nside_chunk, seed=None):
areaperpixel = hp.nside2pixarea(nside, degrees=True)
areaperchunk = hp.nside2pixarea(nside_chunk, degrees=True)

nchunk = 4**np.int(np.log2(nside_chunk) - np.log2(nside))
nchunk = 4**int(np.log2(nside_chunk) - np.log2(nside))
sbailey marked this conversation as resolved.
Show resolved Hide resolved
log.info('Dividing each nside={} healpixel ({:.2f} deg2) into {} nside={} healpixel(s) ({:.2f} deg2).'.format(
nside, areaperpixel, nchunk, nside_chunk, areaperchunk))

Expand Down
6 changes: 1 addition & 5 deletions py/desitarget/randoms.py
Expand Up @@ -1205,11 +1205,6 @@ def pixmap(randoms, targets, rand_density, nside=256, gaialoc=None):
# ADM change target column names, and retrieve associated survey information.
_, Mx, survey, targets = main_cmx_or_sv(targets, rename=True)

# ADM determine the areal coverage of the randoms at this nside.
log.info('Determining footprint...t = {:.1f}s'.format(time()-start))
pw = pixweight(randoms, rand_density, nside=nside)
npix = len(pw)

# ADM areal coverage for some combinations of MASKBITS.
mbcomb = []
mbstore = []
Expand All @@ -1222,6 +1217,7 @@ def pixmap(randoms, targets, rand_density, nside=256, gaialoc=None):
mbstore.append(pixweight(randoms, rand_density,
nside=nside, maskbits=bitint))

# ADM determine the areal coverage of the randoms at this nside.
log.info('Determining footprint...t = {:.1f}s'.format(time()-start))
pw = pixweight(randoms, rand_density, nside=nside)
npix = len(pw)
Expand Down