Browse Source

Proper repackaging

pull/1/head
Benito Marcote 1 year ago
parent
commit
974479c4cb
  1. 23
      app.py
  2. 6
      doc/notes.md
  3. 83
      setup.py
  4. BIN
      src/__pycache__/freqsetups.cpython-36.pyc
  5. BIN
      src/__pycache__/freqsetups.cpython-37.pyc
  6. BIN
      src/__pycache__/functions.cpython-36.pyc
  7. BIN
      src/__pycache__/functions.cpython-37.pyc
  8. BIN
      src/__pycache__/graphical_elements.cpython-36.pyc
  9. BIN
      src/__pycache__/observation.cpython-36.pyc
  10. BIN
      src/__pycache__/observation.cpython-37.pyc
  11. BIN
      src/__pycache__/stations.cpython-36.pyc
  12. BIN
      src/__pycache__/stations.cpython-37.pyc
  13. 0
      tests/test.py
  14. 0
      vlbiplanobs/Checkbox.py
  15. 11
      vlbiplanobs/__init__.py
  16. 0
      vlbiplanobs/freqsetups.py
  17. 7
      vlbiplanobs/functions.py
  18. 10
      vlbiplanobs/graphical_elements.py
  19. 10
      vlbiplanobs/observation.py
  20. 5
      vlbiplanobs/setup.cfg
  21. 6
      vlbiplanobs/stations.py

23
app.py

@ -1,17 +1,16 @@
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
"""EVN Calculator.
"""EVN Observation Planner.
Program to compute the source elevation visibility and expected thermal
noise level for a given EVN observation.
Program to compute the source elevation visibility
and expected thermal noise level for a given EVN observation.
"""
__author__ = "Benito Marcote"
__copyright__ = "Copyright 2020, Joint Insitute for VLBI-ERIC (JIVE)"
__credits__ = "Benito Marcote"
__license__ = "GPL"
__license__ = "LGPLv3+"
__date__ = "2020/04/21"
__version__ = "1.0"
__version__ = "0.3b2"
__maintainer__ = "Benito Marcote"
__email__ = "marcote@jive.eu"
__status__ = "Development" # Prototype, Development, Production.
@ -47,13 +46,13 @@ iers.conf.download_cache_lock_attempts = 10
from astroplan import FixedTarget
from src import freqsetups as fs
from src import stations
from src import functions as fx
from src import observation
from src import graphical_elements as ge
from vlbiplanobs import freqsetups as fs
from vlbiplanobs import stations
from vlbiplanobs import functions as fx
from vlbiplanobs import observation
from vlbiplanobs import graphical_elements as ge
# adding the possibility of disabled
from src.Checkbox import Checkbox
from vlbiplanobs.Checkbox import Checkbox
current_directory = path.dirname(path.realpath(__file__))

6
doc/notes.md

@ -2,16 +2,12 @@
# EVN Source Elevation App
does_eEVN = ['Ef', 'Hh', 'Jb2', 'Jb1', 'Mc', 'Nt', 'On', 'T6', 'Mh', 'Tr', 'Ys', 'Wb', 'Bd', 'Sv', 'Zc', 'Ir', 'Sr', 'Ur', 'Cm', 'Kn', 'Pi', 'Da', 'De']
## Program structure
- app.py
- README.md
- docs/
- src/
- vlbiplanobs/
- stations.py
- sources.py
- plots.py

83
setup.py

@ -0,0 +1,83 @@
from setuptools import setup
import pathlib
# Get the long description from the README file
long_description = (pathlib.Path(__file__).parent.resolve() / 'README.md').read_text(encoding='utf-8')
setup(name='vlbiplanobs',
# Versions should comply with PEP 440:
# https://www.python.org/dev/peps/pep-0440/
# [N!]N(.N)*[{a|b|rc}N][.postN][.devN]
version='1.0b2',
# one-line description or tagline of what your project does
description='Planner for VLBI observations',
# "Description" metadata field
long_description=long_description,
long_description_content_type='text/markdown',
url='https://github.com/bmarcote/vlbi_calculator',
author='B. Marcote',
author_email='marcote@jive.eu',
# Classifiers help users find your project by categorizing it.
# For a list of valid classifiers, see https://pypi.org/classifiers/
classifiers=[ # Optional
# How mature is this project? Common values are
# 3 - Alpha
# 4 - Beta
# 5 - Production/Stable
'Development Status :: 4 - Beta',
# Indicate who your project is intended for
'Intended Audience :: Science/Research',
'Topic :: Scientific/Engineering :: Astronomy',
# Pick your license as you wish
'License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)',
# Specify the Python versions you support here. In particular, ensure
# that you indicate you support Python 3. These classifiers are *not*
# checked by 'pip install'. See instead 'python_requires' below.
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3 :: Only',
],
keywords='astronomy, astrophysics, cosmology, radio, science, observations, planner, coordinate',
# When your source code is in a subdirectory under the project root, e.g.
# `src/`, it is necessary to specify the `package_dir` argument.
# package_dir={'': 'src'}, # Optional
packages=find_packages(where='vlbiplanobs'),
python_requires='>=3.7, <4',
# This field lists other packages that your project depends on to run.
# Any package you put here will be installed by pip when your project is
# installed, so they must be valid existing projects.
#
# For an analysis of "install_requires" vs pip's requirements files see:
# https://packaging.python.org/en/latest/requirements.html
# install_requires=[''],
# If there are data files included in your packages that need to be
# installed, specify them here.
# package_data={
# 'sample': ['package_data.dat'],
# },
# Although 'package_data' is the preferred approach, in some case you may
# need to place data files outside of your packages. See:
# http://docs.python.org/distutils/setupscript.html#installing-additional-files
#
# In this case, 'data_file' will be installed into '<sys.prefix>/my_data'
data_files=[('data', ['data/stations_catalog.inp'])],
# List additional URLs that are relevant to your project as a dict.
#
# This field corresponds to the "Project-URL" metadata fields:
# https://packaging.python.org/specifications/core-metadata/#project-url-multiple-use
#
# Examples listed include a pattern for specifying where the package tracks
# issues, where the source is hosted, where to say thanks to the package
# maintainers, and where to support the project financially. The key is
# what's used to render the link text on PyPI.
project_urls={ # Optional
'Bug Reports': 'https://github.com/bmarcote/vlbi_calculator/issues',
# 'Funding': 'https://donate.pypi.org',
# 'Say Thanks!': 'http://saythanks.io/to/example',
'Source': 'https://github.com/bmarcote/vlbi_calculator/',
},
)

BIN
src/__pycache__/freqsetups.cpython-36.pyc

Binary file not shown.

BIN
src/__pycache__/freqsetups.cpython-37.pyc

Binary file not shown.

BIN
src/__pycache__/functions.cpython-36.pyc

Binary file not shown.

BIN
src/__pycache__/functions.cpython-37.pyc

Binary file not shown.

BIN
src/__pycache__/graphical_elements.cpython-36.pyc

Binary file not shown.

BIN
src/__pycache__/observation.cpython-36.pyc

Binary file not shown.

BIN
src/__pycache__/observation.cpython-37.pyc

Binary file not shown.

BIN
src/__pycache__/stations.cpython-36.pyc

Binary file not shown.

BIN
src/__pycache__/stations.cpython-37.pyc

Binary file not shown.

0
test/test.py → tests/test.py

0
src/Checkbox.py → vlbiplanobs/Checkbox.py

11
vlbiplanobs/__init__.py

@ -0,0 +1,11 @@
import numpy as np
from astropy import coordinates as coord
from astropy import units as u
from astropy.io import ascii
from astropy.time import Time
from astroplan import FixedTarget
from astroplan import Observer
import stations
import functions

0
src/freqsetups.py → vlbiplanobs/freqsetups.py

7
src/functions.py → vlbiplanobs/functions.py

@ -1,13 +1,6 @@
"""Different functions that are required to operate the program
"""
import configparser
from astropy import coordinates as coord
from astropy import units as u
from astropy.io import ascii
from src import stations
def get_stations_from_configfile(filename='data/stations_catalog.inp'):
"""Retrieves the information concerning all stations available in the 'filename'

10
src/graphical_elements.py → vlbiplanobs/graphical_elements.py

@ -1,5 +1,3 @@
import numpy as np
from astropy import units as u
import dash
from dash.dependencies import Input, Output, State
import dash_core_components as dcc
@ -7,8 +5,6 @@ import dash_html_components as html
import dash_bootstrap_components as dbc
import plotly.express as px
from src import functions as fx
def tooltip(message, idname, trigger='?', placement='right',trigger_is_sup=True, **kwargs):
@ -189,14 +185,14 @@ def summary_card_beam(app, obs):
def summary_card_times(app, obs):
"""Creates a summary card showing the observing times, and the resulting data size.
"""
prtobstimes = fx.print_obs_times(obs)
prtobstimes = functions.print_obs_times(obs)
if '\n' in prtobstimes:
tmp = [html.Span(t) for t in fx.print_obs_times(obs).split('\n')]
tmp = [html.Span(t) for t in functions.print_obs_times(obs).split('\n')]
for i in range(len(tmp)-1):
tmp.insert(2*i+1, html.Br())
temp_msg = [tmp]
else:
temp_msg = [f"{fx.print_obs_times(obs)}."]
temp_msg = [f"{functions.print_obs_times(obs)}."]
temp_msg += [f"The observation lasts for {optimal_units(obs.duration, [u.h, u.min, u.s, u.ms]):.3n}, of which {optimal_units(obs.ontarget_time, [u.h, u.min, u.s, u.ms]):.3n} are on target."]
n_files = int(np.ceil(obs.datasize()/(2.0*u.GB)))

10
src/observation.py → vlbiplanobs/observation.py

@ -3,16 +3,6 @@
time range and the observing band.
"""
import numpy as np
# from scipy.interpolate import griddata
from astropy.time import Time
from astropy import coordinates as coord
from astropy import units as u
from astroplan import FixedTarget
from . import stations
class SourceNotVisible(Exception):
pass

5
vlbiplanobs/setup.cfg

@ -0,0 +1,5 @@
[metadata]
# This includes the license file(s) in the wheel.
# https://wheel.readthedocs.io/en/stable/user_guide.html#including-license-files-in-the-generated-wheel-file
license_files = LICENSE

6
src/stations.py → vlbiplanobs/stations.py

@ -1,9 +1,3 @@
import numpy as np
import astropy.units as u
import astropy.coordinates as coord
from astropy.time import Time
from astropy.io import ascii
from astroplan import Observer
class Station(object):
Loading…
Cancel
Save