Skip to content

Commit

Permalink
Release commit created with Cranko.
Browse files Browse the repository at this point in the history
+++ cranko-release-info-v1
[[projects]]
qnames = ["toasty", "pypa"]
version = "0.6.4"
age = 0

+++
  • Loading branch information
cranko committed Feb 9, 2021
2 parents 08ba10f + 11016fb commit 79ba646
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 19 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# toasty 0.6.4 (2021-02-09)

- Properly handle CLI glob arguments on Windows. It turns out that we need to
handle them manually, sigh. This relies on new functionality added in
`wwt_data_formats` 0.9.1 (which I should have versioned as 0.10.0 because it
adds a new API, but oh well).


# toasty 0.6.3 (2021-02-03)

- If a PIL image loads up with an unexpected mode, try to convert it to regular
Expand Down
4 changes: 2 additions & 2 deletions ci/azure-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ jobs:
pillow \
pytest-cov \
pyyaml \
tqdm \
wwt_data_formats
tqdm
pip install wwt_data_formats
pip install -e .
pytest --cov-report=xml --cov=toasty toasty
displayName: Test with coverage
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def get_long_desc():

setup_args = dict(
name = 'toasty', # cranko project-name
version = '0.6.3', # cranko project-version
version = '0.6.4', # cranko project-version
description = 'Generate TOAST image tile pyramids from existing image data',
long_description = get_long_desc(),
long_description_content_type = 'text/markdown',
Expand Down Expand Up @@ -78,7 +78,7 @@ def get_long_desc():
'pillow>=7.0',
'PyYAML>=5.0',
'tqdm>=4.0',
'wwt_data_formats>=0.7.0',
'wwt_data_formats>=0.9.1',
],

extras_require = {
Expand Down
4 changes: 2 additions & 2 deletions toasty/_libtoasty.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ cimport cython

cimport numpy as np

DTYPE = np.float
ctypedef np.float_t DTYPE_t
DTYPE = np.float64
ctypedef np.float64_t DTYPE_t

cdef struct Point:
DTYPE_t x
Expand Down
4 changes: 3 additions & 1 deletion toasty/cli.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- mode: python; coding: utf-8 -*-
# Copyright 2019-2020 the AAS WorldWide Telescope project.
# Copyright 2019-2021 the AAS WorldWide Telescope project.
# Licensed under the MIT License.

"""Entrypoint for the "toasty" command-line interface.
Expand All @@ -17,6 +17,7 @@
import argparse
import os.path
import sys
from wwt_data_formats.cli import EnsureGlobsExpandedAction


# General CLI utilities
Expand Down Expand Up @@ -129,6 +130,7 @@ def multi_tan_make_data_tiles_getparser(parser):
parser.add_argument(
'paths',
metavar = 'PATHS',
action = EnsureGlobsExpandedAction,
nargs = '+',
help = 'The FITS files with image data',
)
Expand Down
3 changes: 3 additions & 0 deletions toasty/pipeline/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import glob
import os.path
import sys
from wwt_data_formats.cli import EnsureGlobsExpandedAction

from ..cli import die, warn
from . import NotActionableError
Expand Down Expand Up @@ -61,6 +62,7 @@ def approve_setup_parser(parser):
parser.add_argument(
'cand_ids',
nargs = '+',
action = EnsureGlobsExpandedAction,
metavar = 'IMAGE-ID',
help = 'Name(s) of image(s) to approve for publication (globs accepted)'
)
Expand Down Expand Up @@ -119,6 +121,7 @@ def fetch_setup_parser(parser):
parser.add_argument(
'cand_ids',
nargs = '+',
action = EnsureGlobsExpandedAction,
metavar = 'CAND-ID',
help = 'Name(s) of candidate(s) to fetch and prepare for processing (globs accepted)'
)
Expand Down
18 changes: 9 additions & 9 deletions toasty/samplers.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- mode: python; coding: utf-8 -*-
# Copyright 2013-2020 Chris Beaumont and the AAS WorldWide Telescope project
# Copyright 2013-2021 Chris Beaumont and the AAS WorldWide Telescope project
# Licensed under the MIT License.

"""
Expand Down Expand Up @@ -177,11 +177,11 @@ def plate_carree_sampler(data):
def vec2pix(lon, lat):
lon = (lon + np.pi) % (2 * np.pi) - np.pi # ensure in range [-pi, pi]
ix = (lon0 - lon) * dx
ix = np.round(ix).astype(np.int)
ix = np.round(ix).astype(int)
ix = np.clip(ix, 0, nx - 1)

iy = (lat0 - lat) * dy # *assume* in range [-pi/2, pi/2]
iy = np.round(iy).astype(np.int)
iy = np.round(iy).astype(int)
iy = np.clip(iy, 0, ny - 1)

return data[iy, ix]
Expand Down Expand Up @@ -223,11 +223,11 @@ def vec2pix(lon, lat):

lon = (lon + np.pi) % (2 * np.pi) - np.pi # ensure in range [-pi, pi]
ix = (lon0 - lon) * dx
ix = np.round(ix).astype(np.int)
ix = np.round(ix).astype(int)
ix = np.clip(ix, 0, nx - 1)

iy = (lat0 - lat) * dy # *assume* in range [-pi/2, pi/2]
iy = np.round(iy).astype(np.int)
iy = np.round(iy).astype(int)
iy = np.clip(iy, 0, ny - 1)

return data[iy, ix]
Expand Down Expand Up @@ -269,11 +269,11 @@ def vec2pix(lon, lat):
lon = lon % (2 * np.pi) - np.pi # ensure in range [-pi, pi]

ix = (lon0 - lon) * dx
ix = np.round(ix).astype(np.int)
ix = np.round(ix).astype(int)
ix = np.clip(ix, 0, nx - 1)

iy = (lat0 - lat) * dy # *assume* in range [-pi/2, pi/2]
iy = np.round(iy).astype(np.int)
iy = np.round(iy).astype(int)
iy = np.clip(iy, 0, ny - 1)

return data[iy, ix]
Expand Down Expand Up @@ -313,11 +313,11 @@ def plate_carree_planet_sampler(data):
def vec2pix(lon, lat):
lon = (lon + np.pi) % (2 * np.pi) - np.pi # ensure in range [-pi, pi]
ix = (lon - lon0) * dx
ix = np.round(ix).astype(np.int)
ix = np.round(ix).astype(int)
ix = np.clip(ix, 0, nx - 1)

iy = (lat0 - lat) * dy # *assume* in range [-pi/2, pi/2]
iy = np.round(iy).astype(np.int)
iy = np.round(iy).astype(int)
iy = np.clip(iy, 0, ny - 1)

return data[iy, ix]
Expand Down
6 changes: 3 additions & 3 deletions toasty/study.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- mode: python; coding: utf-8 -*-
# Copyright 2020 the AAS WorldWide Telescope project
# Copyright 2021 the AAS WorldWide Telescope project
# Licensed under the MIT License.

"""Common routines for tiling images anchored to the sky in a gnomonic
Expand Down Expand Up @@ -193,8 +193,8 @@ def image_to_tile(self, im_ix, im_iy):
"""
gx = im_ix + self._img_gx0
gy = im_iy + self._img_gy0
tile_ix = np.floor(gx // 256).astype(np.int)
tile_iy = np.floor(gy // 256).astype(np.int)
tile_ix = np.floor(gx // 256).astype(int)
tile_iy = np.floor(gy // 256).astype(int)
return (tile_ix, tile_iy, gx % 256, gy % 256)


Expand Down

0 comments on commit 79ba646

Please sign in to comment.