New Upstream Snapshot - pymoc
Ready changes
Summary
Merged new upstream version: 0.5.0+git20170713.3.0e2e57c (was: 0.5.0+git20170713.2.0e2e57c).
Resulting package
Built on 2022-12-19T15:24 (took 17m41s)
The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:
apt install -t fresh-snapshots pymoctoolapt install -t fresh-snapshots python3-pymoc
Lintian Result
Diff
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index 1c70033..0000000
--- a/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-*~
-*.pyc
-/MANIFEST
-/build
-/dist
diff --git a/CHANGES.txt b/CHANGES.txt
deleted file mode 100644
index 1b064e4..0000000
--- a/CHANGES.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-0.5.0 2017-05-30
-
- - Improved speed of MOC generation from catalogs by making use of the
- Healpy "query_disc" function. Additional optional arguments can be
- given to the "catalog_to_moc" function to control this process.
-
- - "pymoctool" now checks that a running MOC is present for some commands.
-
-0.4.2 2017-04-19
-
- - Corrected bug reading MOCs in FITS format on 32-bit systems with
- 64-bit NUNIQ columns.
-
-0.4.1 2016-08-08
-
- - Corrected bug in intersection routine.
- - Added option to skip validation of cell numbers in the "add" method.
-
-0.4.0 2015-11-20
-
- - Added utility to create MOCs from catalog files.
- - "pymoctool" can now invoke the plotting and catalog utilities.
- - Preserve metadata read from FITS file when constructing new MOC object.
-
-0.3.0 2014-11-14
-
- - A command line utility "pymoctool" has been included in the package.
- - Additional keywords are now passed to FITS open and writeto functions.
-
-0.2.0 2014-10-10
-
- - Updated FITS table column name based on the IVOA version 1.0
- MOC recommendation.
- - Defined addition, equality and subtraction operations.
- - Added clear, contains, flattened and intersection methods.
- - Added plotting utility based on Healpy.
-
-0.1.0 2014-05-27
-
- - Initial release.
diff --git a/PKG-INFO b/PKG-INFO
new file mode 100644
index 0000000..333e1c6
--- /dev/null
+++ b/PKG-INFO
@@ -0,0 +1,96 @@
+Metadata-Version: 2.1
+Name: pymoc
+Version: 0.5.0
+Summary: Multi-Order Coverage map module for Python
+Home-page: http://github.com/grahambell/pymoc
+Author: Graham Bell
+Author-email: g.bell@eaobservatory.org
+Classifier: Development Status :: 4 - Beta
+Classifier: Intended Audience :: Science/Research
+Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
+Classifier: Topic :: Scientific/Engineering :: Astronomy
+License-File: COPYING
+
+Multi-Order Coverage map module for Python
+==========================================
+
+Introduction
+------------
+
+.. startpymocintro
+
+PyMOC is a module for manipulating Multi-Order Coverage (MOC)
+maps. It includes support for reading and writing the three
+encodings mentioned in the IVOA recommendation: FITS, JSON
+and ASCII.
+
+PyMOC also includes a utility program ``pymoctool`` to allow
+MOC files to be manipulated from the command line.
+
+.. endpymocintro
+
+.. startpymocinstall
+
+Installation
+------------
+
+The module can be installed using the ``setup.py`` script::
+
+ python setup.py install
+
+Unit Tests
+~~~~~~~~~~
+
+Prior to installation, the unit tests can be run using::
+
+ PYTHONPATH=lib python3 -m unittest
+
+or::
+
+ PYTHONPATH=lib python2 -m unittest discover
+
+The `test-extra` directory contains additional tests which may take
+longer to perform. You can exclude these by specifying just the
+plain `test` directory, for example with::
+
+ PYTHONPATH=lib python -m unittest discover -s test
+
+The routines included in the doctests should also be covered by
+the unit tests. However to ensure the documentation is correct,
+they can be checked with::
+
+ sphinx-build -b doctest doc doc/_build/doctest
+
+Requirements
+~~~~~~~~~~~~
+
+For reading and writing data in FITS format, the ``astropy``
+library is required.
+
+``Healpy`` is needed for some of the utility functions such as
+``plot_moc`` and ``catalog_to_moc``.
+
+.. endpymocinstall
+
+License
+-------
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+Additional Links
+----------------
+
+* `Documentation at Read the Docs <http://pymoc.readthedocs.io/en/latest/>`_
+* `Repository at GitHub <https://github.com/grahambell/pymoc>`_
+* `Entry on PyPI <https://pypi.python.org/pypi/pymoc>`_
diff --git a/debian/changelog b/debian/changelog
index 81379c3..3cf2f51 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+pymoc (0.5.0+git20170713.3.0e2e57c-1) UNRELEASED; urgency=low
+
+ * New upstream snapshot.
+ * New upstream snapshot.
+ * New upstream snapshot.
+
+ -- Debian Janitor <janitor@jelmer.uk> Mon, 19 Dec 2022 15:11:46 -0000
+
pymoc (0.5.0-5) unstable; urgency=medium
* Depend python3-healpy and python3-tk since they are
diff --git a/debian/patches/Skip-catalog-test-if-healpy-is-not-available.patch b/debian/patches/Skip-catalog-test-if-healpy-is-not-available.patch
index fd9069f..eaeaa23 100644
--- a/debian/patches/Skip-catalog-test-if-healpy-is-not-available.patch
+++ b/debian/patches/Skip-catalog-test-if-healpy-is-not-available.patch
@@ -10,10 +10,10 @@ Closes: #895368
test/test_catalog.py | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
-diff --git a/test/test_catalog.py b/test/test_catalog.py
-index cbd6391..5692541 100644
---- a/test/test_catalog.py
-+++ b/test/test_catalog.py
+Index: pymoc.git/test/test_catalog.py
+===================================================================
+--- pymoc.git.orig/test/test_catalog.py
++++ pymoc.git/test/test_catalog.py
@@ -13,15 +13,20 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
@@ -25,16 +25,15 @@ index cbd6391..5692541 100644
from pymoc import MOC
-from pymoc.util.catalog import catalog_to_moc, catalog_to_cells
--
--
--class CatalogTestCase(TestCase):
+try:
+ import healpy
+ has_healpy = True
+ from pymoc.util.catalog import catalog_to_moc, catalog_to_cells
+except ImportError:
+ has_healpy = False
-+
+
+-
+-class CatalogTestCase(TestCase):
+@unittest.skipUnless(has_healpy, "Healpy is not available")
+class CatalogTestCase(unittest.TestCase):
def test_cells(self):
diff --git a/debian/patches/pymoctool-python3-shebang.patch b/debian/patches/pymoctool-python3-shebang.patch
index af2c027..e79d8e6 100644
--- a/debian/patches/pymoctool-python3-shebang.patch
+++ b/debian/patches/pymoctool-python3-shebang.patch
@@ -9,10 +9,10 @@ Python 3 based on feedback Python 3 should be preferred.
scripts/pymoctool | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-diff --git a/scripts/pymoctool b/scripts/pymoctool
-index ed807b7..03e8652 100755
---- a/scripts/pymoctool
-+++ b/scripts/pymoctool
+Index: pymoc.git/scripts/pymoctool
+===================================================================
+--- pymoc.git.orig/scripts/pymoctool
++++ pymoc.git/scripts/pymoctool
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
diff --git a/doc/.gitignore b/doc/.gitignore
deleted file mode 100644
index a485625..0000000
--- a/doc/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/_build
diff --git a/doc/conf.py b/doc/conf.py
deleted file mode 100644
index 582005b..0000000
--- a/doc/conf.py
+++ /dev/null
@@ -1,278 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-#
-# PyMOC documentation build configuration file, created by
-# sphinx-quickstart on Wed May 21 17:01:13 2014.
-#
-# This file is execfile()d with the current directory set to its
-# containing dir.
-#
-# Note that not all possible configuration values are present in this
-# autogenerated file.
-#
-# All configuration values have a default; values that are commented out
-# serve to show the default.
-
-import sys
-import os
-
-# If extensions (or modules to document with autodoc) are in another directory,
-# add these directories to sys.path here. If the directory is relative to the
-# documentation root, use os.path.abspath to make it absolute, like shown here.
-sys.path.insert(0, os.path.abspath('../lib'))
-
-# Allow autodoc documentation to be built without optional requirements
-# being installed.
-# See: https://docs.readthedocs.org/en/latest/faq.html#i-get-import-errors-on-libraries-that-depend-on-c-modules
-# and: http://blog.rtwilson.com/how-to-make-your-sphinx-documentation-compile-with-readthedocs-when-youre-using-numpy-and-scipy/
-try:
- from unittest.mock import Mock
-except ImportError:
- from mock import Mock
-for mod_name in (
- 'astropy', 'astropy.coordinates', 'astropy.io',
- 'astropy.units', 'astropy.units.quantity',
- 'healpy', 'healpy.pixelfunc',
- 'matplotlib', 'matplotlib.colors', 'matplotlib.pyplot', 'numpy'):
- sys.modules[mod_name] = Mock()
-
-# -- General configuration ------------------------------------------------
-
-# If your documentation needs a minimal Sphinx version, state it here.
-#needs_sphinx = '1.0'
-
-# Add any Sphinx extension module names here, as strings. They can be
-# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
-# ones.
-extensions = [
- 'sphinx.ext.autodoc',
- 'sphinx.ext.doctest',
-]
-
-# Add any paths that contain templates here, relative to this directory.
-templates_path = ['_templates']
-
-# The suffix of source filenames.
-source_suffix = '.rst'
-
-# The encoding of source files.
-#source_encoding = 'utf-8-sig'
-
-# The master toctree document.
-master_doc = 'index'
-
-# General information about the project.
-project = 'PyMOC'
-copyright = '2014, Science and Technology Facilities Council'
-
-# The version info for the project you're documenting, acts as replacement for
-# |version| and |release|, also used in various other places throughout the
-# built documents.
-#
-# The short X.Y version.
-# version = 'X.X.X'
-from pymoc.version import version
-# The full version, including alpha/beta/rc tags.
-release = version
-
-# The language for content autogenerated by Sphinx. Refer to documentation
-# for a list of supported languages.
-#language = None
-
-# There are two options for replacing |today|: either, you set today to some
-# non-false value, then it is used:
-#today = ''
-# Else, today_fmt is used as the format for a strftime call.
-#today_fmt = '%B %d, %Y'
-
-# List of patterns, relative to source directory, that match files and
-# directories to ignore when looking for source files.
-exclude_patterns = ['_build']
-
-# The reST default role (used for this markup: `text`) to use for all
-# documents.
-#default_role = None
-
-# If true, '()' will be appended to :func: etc. cross-reference text.
-#add_function_parentheses = True
-
-# If true, the current module name will be prepended to all description
-# unit titles (such as .. function::).
-#add_module_names = True
-
-# If true, sectionauthor and moduleauthor directives will be shown in the
-# output. They are ignored by default.
-#show_authors = False
-
-# The name of the Pygments (syntax highlighting) style to use.
-pygments_style = 'sphinx'
-
-# A list of ignored prefixes for module index sorting.
-#modindex_common_prefix = []
-
-# If true, keep warnings as "system message" paragraphs in the built documents.
-#keep_warnings = False
-
-
-# -- Options for HTML output ----------------------------------------------
-
-# The theme to use for HTML and HTML Help pages. See the documentation for
-# a list of builtin themes.
-html_theme = 'default'
-
-# Theme options are theme-specific and customize the look and feel of a theme
-# further. For a list of options available for each theme, see the
-# documentation.
-#html_theme_options = {}
-
-# Add any paths that contain custom themes here, relative to this directory.
-#html_theme_path = []
-
-# The name for this set of Sphinx documents. If None, it defaults to
-# "<project> v<release> documentation".
-#html_title = None
-
-# A shorter title for the navigation bar. Default is the same as html_title.
-#html_short_title = None
-
-# The name of an image file (relative to this directory) to place at the top
-# of the sidebar.
-#html_logo = None
-
-# The name of an image file (within the static path) to use as favicon of the
-# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
-# pixels large.
-#html_favicon = None
-
-# Add any paths that contain custom static files (such as style sheets) here,
-# relative to this directory. They are copied after the builtin static files,
-# so a file named "default.css" will overwrite the builtin "default.css".
-html_static_path = ['_static']
-
-# Add any extra paths that contain custom files (such as robots.txt or
-# .htaccess) here, relative to this directory. These files are copied
-# directly to the root of the documentation.
-#html_extra_path = []
-
-# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
-# using the given strftime format.
-#html_last_updated_fmt = '%b %d, %Y'
-
-# If true, SmartyPants will be used to convert quotes and dashes to
-# typographically correct entities.
-#html_use_smartypants = True
-
-# Custom sidebar templates, maps document names to template names.
-#html_sidebars = {}
-
-# Additional templates that should be rendered to pages, maps page names to
-# template names.
-#html_additional_pages = {}
-
-# If false, no module index is generated.
-#html_domain_indices = True
-
-# If false, no index is generated.
-#html_use_index = True
-
-# If true, the index is split into individual pages for each letter.
-#html_split_index = False
-
-# If true, links to the reST sources are added to the pages.
-#html_show_sourcelink = True
-
-# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
-#html_show_sphinx = True
-
-# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
-#html_show_copyright = True
-
-# If true, an OpenSearch description file will be output, and all pages will
-# contain a <link> tag referring to it. The value of this option must be the
-# base URL from which the finished HTML is served.
-#html_use_opensearch = ''
-
-# This is the file name suffix for HTML files (e.g. ".xhtml").
-#html_file_suffix = None
-
-# Output file base name for HTML help builder.
-htmlhelp_basename = 'PyMOCdoc'
-
-
-# -- Options for LaTeX output ---------------------------------------------
-
-latex_elements = {
-# The paper size ('letterpaper' or 'a4paper').
-#'papersize': 'letterpaper',
-
-# The font size ('10pt', '11pt' or '12pt').
-#'pointsize': '10pt',
-
-# Additional stuff for the LaTeX preamble.
-#'preamble': '',
-}
-
-# Grouping the document tree into LaTeX files. List of tuples
-# (source start file, target name, title,
-# author, documentclass [howto, manual, or own class]).
-latex_documents = [
- ('index', 'PyMOC.tex', 'PyMOC Documentation',
- 'Graham Bell', 'manual'),
-]
-
-# The name of an image file (relative to this directory) to place at the top of
-# the title page.
-#latex_logo = None
-
-# For "manual" documents, if this is true, then toplevel headings are parts,
-# not chapters.
-#latex_use_parts = False
-
-# If true, show page references after internal links.
-#latex_show_pagerefs = False
-
-# If true, show URL addresses after external links.
-#latex_show_urls = False
-
-# Documents to append as an appendix to all manuals.
-#latex_appendices = []
-
-# If false, no module index is generated.
-#latex_domain_indices = True
-
-
-# -- Options for manual page output ---------------------------------------
-
-# One entry per manual page. List of tuples
-# (source start file, name, description, authors, manual section).
-man_pages = [
- ('index', 'pymoc', 'PyMOC Documentation',
- ['Graham Bell'], 1)
-]
-
-# If true, show URL addresses after external links.
-#man_show_urls = False
-
-
-# -- Options for Texinfo output -------------------------------------------
-
-# Grouping the document tree into Texinfo files. List of tuples
-# (source start file, target name, title, author,
-# dir menu entry, description, category)
-texinfo_documents = [
- ('index', 'PyMOC', 'PyMOC Documentation',
- 'Graham Bell', 'PyMOC', 'One line description of project.',
- 'Miscellaneous'),
-]
-
-# Documents to append as an appendix to all manuals.
-#texinfo_appendices = []
-
-# If false, no module index is generated.
-#texinfo_domain_indices = True
-
-# How to display URL addresses: 'footnote', 'no', or 'inline'.
-#texinfo_show_urls = 'footnote'
-
-# If true, do not generate a @detailmenu in the "Top" node's menu.
-#texinfo_no_detailmenu = False
diff --git a/doc/index.rst b/doc/index.rst
deleted file mode 100644
index cf31f7c..0000000
--- a/doc/index.rst
+++ /dev/null
@@ -1,25 +0,0 @@
-PyMOC
-=====
-
-.. include:: ../README.rst
- :start-after: .. startpymocintro
- :end-before: .. endpymocintro
-
-Contents
---------
-
-.. toctree::
- :maxdepth: 2
-
- install
- moc
- io
- util
-
-Indices and tables
-------------------
-
-* :ref:`genindex`
-* :ref:`modindex`
-* :ref:`search`
-
diff --git a/doc/install.rst b/doc/install.rst
deleted file mode 100644
index c9fabdb..0000000
--- a/doc/install.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-.. include:: ../README.rst
- :start-after: .. startpymocinstall
- :end-before: .. endpymocinstall
diff --git a/doc/io.rst b/doc/io.rst
deleted file mode 100644
index 1bba4c3..0000000
--- a/doc/io.rst
+++ /dev/null
@@ -1,41 +0,0 @@
-I/O Functions
-=============
-
-Input and output (I/O) functions for the three encodings
-used by MOC are located in a separate part of the package.
-This is to allow you to use the :class:`~pymoc.moc.MOC` class
-itself without needing the requirements of the I/O
-routines.
-
-For general file handling, the giving the ``filename``
-argument to the :class:`~pymoc.moc.MOC` constructor,
-or using the :meth:`~pymoc.moc.MOC.read` and
-:meth:`~pymoc.moc.MOC.write` methods may be sufficient.
-The dedicated I/O functions described here can be used in
-more specialized situations, such as interacting with
-FITS HDU objects or reading and writing already-open
-file objects.
-
-pymoc.io.ascii
---------------
-
-.. automodule:: pymoc.io.ascii
- :members:
- :member-order: bysource
- :undoc-members:
-
-pymoc.io.fits
--------------
-
-.. automodule:: pymoc.io.fits
- :members:
- :member-order: bysource
- :undoc-members:
-
-pymoc.io.json
--------------
-
-.. automodule:: pymoc.io.json
- :members:
- :member-order: bysource
- :undoc-members:
diff --git a/doc/moc.rst b/doc/moc.rst
deleted file mode 100644
index 3c34b69..0000000
--- a/doc/moc.rst
+++ /dev/null
@@ -1,23 +0,0 @@
-The MOC Class
-=============
-
-pymoc
------
-
-.. module:: pymoc
-
-The ``pymoc`` module imports the :class:`~pymoc.moc.MOC` class
-from the :mod:`pymoc.moc` module, allowing it to be imported
-as follows::
-
- from pymoc import MOC
-
-pymoc.moc
----------
-
-.. automodule:: pymoc.moc
- :members:
- :member-order: bysource
- :undoc-members:
- :special-members: __init__, __iter__, __len__, __getitem__,
- __iadd__, __add__, __isub__, __sub__, __eq__, __repr__
diff --git a/doc/util.rst b/doc/util.rst
deleted file mode 100644
index 3dd4bb2..0000000
--- a/doc/util.rst
+++ /dev/null
@@ -1,24 +0,0 @@
-Utilities
-=========
-
-pymoc.util.catalog
-------------------
-
-.. automodule:: pymoc.util.catalog
- :members:
- :member-order: bysource
-
-pymoc.util.plot
----------------
-
-.. automodule:: pymoc.util.plot
- :members:
- :member-order: bysource
- :undoc-members:
-
-pymoc.util.tool
----------------
-
-.. automodule:: pymoc.util.tool
- :members:
- :member-order: bysource
diff --git a/lib/pymoc.egg-info/PKG-INFO b/lib/pymoc.egg-info/PKG-INFO
new file mode 100644
index 0000000..333e1c6
--- /dev/null
+++ b/lib/pymoc.egg-info/PKG-INFO
@@ -0,0 +1,96 @@
+Metadata-Version: 2.1
+Name: pymoc
+Version: 0.5.0
+Summary: Multi-Order Coverage map module for Python
+Home-page: http://github.com/grahambell/pymoc
+Author: Graham Bell
+Author-email: g.bell@eaobservatory.org
+Classifier: Development Status :: 4 - Beta
+Classifier: Intended Audience :: Science/Research
+Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
+Classifier: Topic :: Scientific/Engineering :: Astronomy
+License-File: COPYING
+
+Multi-Order Coverage map module for Python
+==========================================
+
+Introduction
+------------
+
+.. startpymocintro
+
+PyMOC is a module for manipulating Multi-Order Coverage (MOC)
+maps. It includes support for reading and writing the three
+encodings mentioned in the IVOA recommendation: FITS, JSON
+and ASCII.
+
+PyMOC also includes a utility program ``pymoctool`` to allow
+MOC files to be manipulated from the command line.
+
+.. endpymocintro
+
+.. startpymocinstall
+
+Installation
+------------
+
+The module can be installed using the ``setup.py`` script::
+
+ python setup.py install
+
+Unit Tests
+~~~~~~~~~~
+
+Prior to installation, the unit tests can be run using::
+
+ PYTHONPATH=lib python3 -m unittest
+
+or::
+
+ PYTHONPATH=lib python2 -m unittest discover
+
+The `test-extra` directory contains additional tests which may take
+longer to perform. You can exclude these by specifying just the
+plain `test` directory, for example with::
+
+ PYTHONPATH=lib python -m unittest discover -s test
+
+The routines included in the doctests should also be covered by
+the unit tests. However to ensure the documentation is correct,
+they can be checked with::
+
+ sphinx-build -b doctest doc doc/_build/doctest
+
+Requirements
+~~~~~~~~~~~~
+
+For reading and writing data in FITS format, the ``astropy``
+library is required.
+
+``Healpy`` is needed for some of the utility functions such as
+``plot_moc`` and ``catalog_to_moc``.
+
+.. endpymocinstall
+
+License
+-------
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+Additional Links
+----------------
+
+* `Documentation at Read the Docs <http://pymoc.readthedocs.io/en/latest/>`_
+* `Repository at GitHub <https://github.com/grahambell/pymoc>`_
+* `Entry on PyPI <https://pypi.python.org/pypi/pymoc>`_
diff --git a/lib/pymoc.egg-info/SOURCES.txt b/lib/pymoc.egg-info/SOURCES.txt
new file mode 100644
index 0000000..d5e3c82
--- /dev/null
+++ b/lib/pymoc.egg-info/SOURCES.txt
@@ -0,0 +1,33 @@
+COPYING
+MANIFEST.in
+README.rst
+setup.py
+lib/pymoc/__init__.py
+lib/pymoc/moc.py
+lib/pymoc/version.py
+lib/pymoc.egg-info/PKG-INFO
+lib/pymoc.egg-info/SOURCES.txt
+lib/pymoc.egg-info/dependency_links.txt
+lib/pymoc.egg-info/top_level.txt
+lib/pymoc/io/__init__.py
+lib/pymoc/io/ascii.py
+lib/pymoc/io/fits.py
+lib/pymoc/io/json.py
+lib/pymoc/util/__init__.py
+lib/pymoc/util/catalog.py
+lib/pymoc/util/plot.py
+lib/pymoc/util/tool.py
+scripts/pymoctool
+test/__init__.py
+test/test_area.py
+test/test_ascii.py
+test/test_catalog.py
+test/test_fits.py
+test/test_flatten.py
+test/test_json.py
+test/test_meta.py
+test/test_normalize.py
+test/test_operators.py
+test/test_properties.py
+test-extra/__init__.py
+test-extra/test_operators_random.py
\ No newline at end of file
diff --git a/lib/pymoc.egg-info/dependency_links.txt b/lib/pymoc.egg-info/dependency_links.txt
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/lib/pymoc.egg-info/dependency_links.txt
@@ -0,0 +1 @@
+
diff --git a/lib/pymoc.egg-info/top_level.txt b/lib/pymoc.egg-info/top_level.txt
new file mode 100644
index 0000000..c10fc28
--- /dev/null
+++ b/lib/pymoc.egg-info/top_level.txt
@@ -0,0 +1 @@
+pymoc
diff --git a/lib/pymoc/io/ascii.py b/lib/pymoc/io/ascii.py
index 093fd3c..552efcd 100644
--- a/lib/pymoc/io/ascii.py
+++ b/lib/pymoc/io/ascii.py
@@ -1,4 +1,5 @@
# Copyright (C) 2014 Science and Technology Facilities Council.
+# Copyright (C) 2017 East Asian Observatory.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -61,6 +62,9 @@ def read_moc_ascii(moc, filename=None, file=None):
orders = _read_ascii(f)
for text in orders:
+ if not text:
+ continue
+
cells = []
(order, ranges) = text.split('/')
for r in ranges.split(','):
diff --git a/lib/pymoc/moc.py b/lib/pymoc/moc.py
index 71c3fa1..89998ec 100644
--- a/lib/pymoc/moc.py
+++ b/lib/pymoc/moc.py
@@ -737,7 +737,8 @@ class MOC(object):
Any additional keyword arguments (kwargs) are passed on to
the corresponding pymoc.io write functions (write_moc_fits,
write_moc_json or write_moc_ascii). This can be used, for
- example, to set clobber=True when writing FITS files.
+ example, to set overwrite=True (or clobber=True prior to
+ Astropy version 2.0) when writing FITS files.
"""
if filetype is not None:
diff --git a/lib/pymoc/util/catalog.py b/lib/pymoc/util/catalog.py
index 685dcb6..0d568cc 100644
--- a/lib/pymoc/util/catalog.py
+++ b/lib/pymoc/util/catalog.py
@@ -132,6 +132,9 @@ def catalog_to_cells(catalog, radius, order, include_fallback=True, **kwargs):
`query_disc` may find none inside the radius. In this case,
if `include_fallback` is `True` (the default), the cell at each
position is included.
+
+ If the given radius is zero (or smaller) then Healpy `query_disc`
+ is not used -- instead the fallback position is used automatically.
"""
nside = 2 ** order
@@ -158,17 +161,21 @@ def catalog_to_cells(catalog, radius, order, include_fallback=True, **kwargs):
# Query for a list of cells for each catalog position.
cells = set()
for vector in vectors:
- # Try "disc" query.
- vector_cells = query_disc(nside, vector, radius, nest=True, **kwargs)
+ if radius > 0.0:
+ # Try "disc" query.
+ vector_cells = query_disc(nside, vector, radius, nest=True, **kwargs)
+
+ if vector_cells.size > 0:
+ cells.update(vector_cells.tolist())
+ continue
- if vector_cells.size > 0:
- cells.update(vector_cells.tolist())
+ elif not include_fallback:
+ continue
- elif include_fallback:
- # The query didn't find anything -- include the cell at the
- # given position at least.
- cell = vec2pix(nside, vector[0], vector[1], vector[2], nest=True)
- cells.add(cell.item())
+ # The query didn't find anything -- include the cell at the
+ # given position at least.
+ cell = vec2pix(nside, vector[0], vector[1], vector[2], nest=True)
+ cells.add(cell.item())
return cells
diff --git a/requirements.txt b/requirements.txt
deleted file mode 100644
index ae8bed8..0000000
--- a/requirements.txt
+++ /dev/null
@@ -1 +0,0 @@
-astropy
diff --git a/setup.cfg b/setup.cfg
new file mode 100644
index 0000000..8bfd5a1
--- /dev/null
+++ b/setup.cfg
@@ -0,0 +1,4 @@
+[egg_info]
+tag_build =
+tag_date = 0
+
diff --git a/test-extra/test_operators_random.py b/test-extra/test_operators_random.py
index 5a314f5..a1c69e1 100644
--- a/test-extra/test_operators_random.py
+++ b/test-extra/test_operators_random.py
@@ -34,11 +34,11 @@ class OperatorsRandomizedTestCase(TestCase):
i_pq = p.intersection(q)
i_qp = q.intersection(p)
- # p.write('test_moc_p_{}.fits'.format(i + 1), clobber=True)
- # q.write('test_moc_q_{}.fits'.format(i + 1), clobber=True)
- # s_pq.write('test_moc_pq_{}.fits'.format(i + 1), clobber=True)
- # s_qp.write('test_moc_qp_{}.fits'.format(i + 1), clobber=True)
- # i_pq.write('test_moc_i_{}.fits'.format(i + 1), clobber=True)
+ # p.write('test_moc_p_{}.fits'.format(i + 1), overwrite=True)
+ # q.write('test_moc_q_{}.fits'.format(i + 1), overwrite=True)
+ # s_pq.write('test_moc_pq_{}.fits'.format(i + 1), overwrite=True)
+ # s_qp.write('test_moc_qp_{}.fits'.format(i + 1), overwrite=True)
+ # i_pq.write('test_moc_i_{}.fits'.format(i + 1), overwrite=True)
# Intersection should be the same both ways round.
self.assertEqual(i_pq, i_qp)
diff --git a/test/test_ascii.py b/test/test_ascii.py
index 094d0ca..b3b0be3 100644
--- a/test/test_ascii.py
+++ b/test/test_ascii.py
@@ -1,4 +1,5 @@
# Copyright (C) 2014 Science and Technology Facilities Council.
+# Copyright (C) 2017 East Asian Observatory.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -41,6 +42,15 @@ class ASCIITestCase(TestCase):
self.assertEqual(out.getvalue(), test_ascii_sorted)
+ def test_ascii_empty(self):
+ in_ = StringIO('')
+
+ moc = MOC()
+ read_moc_ascii(moc, file=in_)
+
+ self.assertEqual(moc.order, 0)
+ self.assertEqual(moc[0], frozenset())
+
def test_ascii_large(self):
orig = MOC()
orig.add(29, [
diff --git a/test/test_catalog.py b/test/test_catalog.py
index cbd6391..08c02d7 100644
--- a/test/test_catalog.py
+++ b/test/test_catalog.py
@@ -55,6 +55,14 @@ class CatalogTestCase(TestCase):
self.assertGreater(len(inclusive), len(cells))
self.assertTrue(inclusive.issuperset(cells))
+ # Test a cell close to a boundary.
+ catalog = SkyCoord(44.978, 1.304, frame='icrs', unit='deg')
+ cells = catalog_to_cells(catalog, 10, 12, inclusive=True)
+ self.assertEqual(cells, set((12344, 12345, 12346, 12347,)))
+
+ cells = catalog_to_cells(catalog, 0, 12, inclusive=True)
+ self.assertEqual(cells, set((12344,)))
+
def test_catalog(self):
catalog = SkyCoord([150.0, 300.0], [-45.0, 45.0],
frame='icrs', unit='deg')
Debdiff
[The following lists of changes regard files as different if they have different names, permissions or owners.]
Files in first set of .debs but not in second
-rw-r--r-- root/root /usr/share/doc/pymoctool/changelog.gz -rw-r--r-- root/root /usr/share/doc/python3-pymoc/changelog.gz
No differences were encountered between the control files of package pymoctool
No differences were encountered between the control files of package python3-pymoc