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

De namespace #13

Merged
merged 3 commits into from
Jan 23, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Ska.astro documentation build configuration file, created by
# ska_astro documentation build configuration file, created by
# sphinx-quickstart on Tue May 19 15:46:11 2020.
#
# This file is execfile()d with the current directory set to its
Expand All @@ -20,7 +20,7 @@
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
from Ska.astro import __version__
from ska_astro import __version__

# -- General configuration ------------------------------------------------

Expand Down Expand Up @@ -49,7 +49,7 @@
master_doc = 'index'

# General information about the project.
project = 'Ska.astro'
project = 'ska_astro'
copyright = '2020, Tom Aldcroft'
author = 'Tom Aldcroft'

Expand Down Expand Up @@ -89,8 +89,8 @@
html_theme = 'bootstrap-ska'
html_theme_options = {
'logotext1': 'Ska! ', # white, semi-bold
'logotext2': 'Ska', # orange, light
'logotext3': '.astro', # white, light
'logotext2': 'ska_astro', # orange, light
'logotext3': '', # white, light
'homepage_url': 'https://cxc.cfa.harvard.edu/mta/ASPECT/tool_doc',
'homepage_text': 'ska',
'homepage_text_2': 'tools'
Expand Down Expand Up @@ -153,7 +153,7 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'Skaastro.tex', 'Ska.astro Documentation',
(master_doc, 'Skaastro.tex', 'ska_astro Documentation',
'Tom Aldcroft', 'manual'),
]

Expand All @@ -163,7 +163,7 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'chandratime', 'Ska.astro Documentation',
(master_doc, 'chandratime', 'ska_astro Documentation',
[author], 1)
]

Expand All @@ -174,7 +174,7 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'Skaastro', 'Ska.astro Documentation',
(master_doc, 'Skaastro', 'ska_astro Documentation',
author, 'Skaastro', 'One line description of project.',
'Miscellaneous'),
]
Expand Down
4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
:mod:`Ska.astro`
:mod:`ska_astro`
===============================================================================================================================================

.. automodule:: Ska.astro
.. automodule:: ska_astro.astro
:members:
21 changes: 15 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from setuptools import setup
setup(name='Ska.astro',
from ska_helpers.setup_helper import duplicate_package_info

name = "ska_astro"
namespace = "Ska.astro"

packages = ["ska_astro"]
package_dir = {name: name}

duplicate_package_info(packages, name, namespace)
duplicate_package_info(package_dir, name, namespace)

setup(name=name,
author = 'Tom Aldcroft',
description='Astronomy utilities',
author_email = 'aldcroft@head.cfa.harvard.edu',
py_modules = ['Ska.astro'],
author_email = 'taldcroft@cfa.harvard.edu',
use_scm_version=True,
setup_requires=['setuptools_scm', 'setuptools_scm_git_archive'],
zip_safe=False,
packages=['Ska'],
package_dir={'Ska' : 'Ska'},
package_data={}
packages=packages,
package_dir=package_dir,
)
6 changes: 6 additions & 0 deletions ska_astro/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import ska_helpers

from .astro import * # noqa

__version__ = ska_helpers.get_version("ska_astro")
13 changes: 5 additions & 8 deletions Ska/astro.py → ska_astro/astro.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
import re
from math import floor

import ska_helpers

__version__ = ska_helpers.get_version(__name__)

class Equatorial(object):
"""Bare-bones class to get between decimal and sexigesimal representations of
Expand All @@ -31,9 +28,9 @@ class Equatorial(object):

Examples::

>>> pos = Ska.astro.Equatorial(123.4, "-34.12")
>>> pos = Ska.astro.Equatorial("12:01:02.34, -34:12:34.11")
>>> pos = Ska.astro.Equatorial("12 01 02.34", "-34d12m34.11s")
>>> pos = ska_astro.Equatorial(123.4, "-34.12")
>>> pos = ska_astro.Equatorial("12:01:02.34, -34:12:34.11")
>>> pos = ska_astro.Equatorial("12 01 02.34", "-34d12m34.11s")
>>> print(pos)
RA, Dec = 180.25975, -34.2095 = 12:01:02.340, -34:12:34.11
>>> pos.delim = " "
Expand Down Expand Up @@ -127,9 +124,9 @@ def sph_dist(a1, d1, a2, d2):
The input coordinates can be either native python types (float, int) or
numpy arrays. The output will matchin the input type.

>>> Ska.astro.sph_dist(1, 2, 3, 4)
>>> ska_astro.sph_dist(1, 2, 3, 4)
2.8264172166623145
>>> Ska.astro.sph_dist(1, 2, np.array([1,2,3,4]), np.array([4,5,6,7]))
>>> ska_astro.sph_dist(1, 2, np.array([1,2,3,4]), np.array([4,5,6,7]))
array([ 2. , 3.16165191, 4.46977556, 5.82570185])

:param a1: RA position 1 (deg)
Expand Down