Skip to content

Commit

Permalink
Add tests and fix style issues
Browse files Browse the repository at this point in the history
Signed-off-by: Adam.Dybbroe <[email protected]>
  • Loading branch information
Adam.Dybbroe committed Nov 22, 2024
1 parent 8e82f37 commit 472c1e0
Show file tree
Hide file tree
Showing 27 changed files with 340 additions and 300 deletions.
3 changes: 2 additions & 1 deletion .bandit
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[bandit]
exclude: trollsched/version.py,versioneer.py,trollsched/tests
skips: B506
exclude: trollsched/tests
1 change: 0 additions & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ commit = True
tag = True

[bumpversion:file:trollsched/version.py]

2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
```
#### Problem description

[this should also explain **why** the current behaviour is a problem and why the
[this should also explain **why** the current behaviour is a problem and why the
expected output is a better solution.]

#### Expected Output
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,3 @@ tmp
# Version
# this should be generated automatically when installed
trollsched/version.py

1 change: 0 additions & 1 deletion .stickler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ files:
ignore:
- 'docs/Makefile'
- 'docs/make.bat'

3 changes: 0 additions & 3 deletions changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,3 @@ v0.2.0 (2014-05-20)
- Renamed a few things to avoid -_ problems. [Martin Raspaud]
- Initial commit. [Martin Raspaud]
- Initial commit. [Martin Raspaud]



1 change: 0 additions & 1 deletion docs/about.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,3 @@ A is respected.

This operation can be extended to more than two stations, all receiving a
single-operation schedule and an individual cooperating-schedule.

37 changes: 18 additions & 19 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys, 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
Expand All @@ -25,32 +24,32 @@

# 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.intersphinx', 'sphinx.ext.pngmath']
extensions = ["sphinx.ext.autodoc", "sphinx.ext.intersphinx", "sphinx.ext.pngmath"]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# The suffix of source filenames.
source_suffix = '.rst'
source_suffix = ".rst"

# The encoding of source files.
#source_encoding = 'utf-8-sig'

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# General information about the project.
project = u'pytroll-schedule'
copyright = u'2014, Martin Raspaud'
project = u"pytroll-schedule"
copyright = u"2014, 2024-{}, The PyTroll Team".format(dt.datetime.utcnow().strftime("%Y")) # noqa: A001

# 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 = '0.1.0'
version = "0.1.0"
# The full version, including alpha/beta/rc tags.
release = '0.1.0'
release = "0.1.0"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand All @@ -64,7 +63,7 @@

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['_build']
exclude_patterns = ["_build"]

# The reST default role (used for this markup: `text`) to use for all documents.
#default_role = None
Expand All @@ -81,7 +80,7 @@
#show_authors = False

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
pygments_style = "sphinx"

# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []
Expand All @@ -91,7 +90,7 @@

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'default'
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
Expand Down Expand Up @@ -120,7 +119,7 @@
# 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']
html_static_path = ["_static"]

# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
Expand Down Expand Up @@ -164,7 +163,7 @@
#html_file_suffix = None

# Output file base name for HTML help builder.
htmlhelp_basename = 'pytroll-scheduledoc'
htmlhelp_basename = "pytroll-scheduledoc"


# -- Options for LaTeX output --------------------------------------------------
Expand All @@ -178,8 +177,8 @@
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'pytroll-schedule.tex', u'pytroll-schedule Documentation',
u'Martin Raspaud', 'manual'),
("index", "pytroll-schedule.tex", u"pytroll-schedule Documentation",
u"Martin Raspaud", "manual"),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -211,10 +210,10 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'pytroll-schedule', u'pytroll-schedule Documentation',
[u'Martin Raspaud'], 1)
("index", "pytroll-schedule", u"pytroll-schedule Documentation",
[u"Martin Raspaud"], 1)
]


# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'http://docs.python.org/': None}
intersphinx_mapping = {"http://docs.python.org/": None}
7 changes: 3 additions & 4 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ Contents:

.. toctree::
:maxdepth: 2

about
miscellaneous

.. toctree::
:maxdepth: 1

usage
config
example
Expand All @@ -29,4 +29,3 @@ Indices and tables
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

8 changes: 4 additions & 4 deletions docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Installation
mkdir $HOME/PyTROLL
cd !$
mkdir data-in data-out etc

#dnf install pyshp python-configobj numpy numpy-f2py scipy python-numexpr \
#python-pillow proj proj-epsg proj-nad pyproj python2-matplotlib python-basemap
#
Expand All @@ -16,15 +16,15 @@ Installation
wget https://github.com/pytroll/trollcast/archive/master.zip -O trollcast-master.zip
wget https://github.com/pytroll/pytroll-schedule/archive/master.zip -O pytroll-schedule-master.zip
wget https://github.com/pytroll/trollduction/archive/master.zip -O trollduction-master.zip


for ff in *.zip ; do
unzip -u $ff
cd $(basename $ff .zip)
python setup.py build
python setup.py install --user
done
cat <<EE
export PPP_CONFIG_DIR=$HOME/PyTROLL/etc
export XRIT_DECOMPRESS_OUTDIR=$HOME/PyTROLL/data-out
Expand Down
8 changes: 2 additions & 6 deletions docs/miscellaneous.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ The ftp adressses are:


.. Earth Observing System Polar Ground Network (EPGN)
EPGN ground stations: Alaska Ground Station (AGS), Poker Flat, the Svalbard
Satellite Station (SGS), the Kongsberg–Lockheed Martin ground station (SKS),
and the SvalSat ground station (SG3) in Norway, as well as the SSC North
Pole facility.
SSC's North Pole Facility hosting the two antennas USAK04 & USAK05 (part of EPGN)
Expand All @@ -52,7 +52,3 @@ This will be read by Pytroll-schedule in order to disregard Metop-A where there
no Direct Readout available over the relavnt local reception station. NOT YET IMPLEMENTED!

.. FIXME!
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ authors = [
dependencies = ["numpy",
"pyresample >= 1.22",
"pyorbital",
"shapely",
"geopandas",
"pandas",
"pyyaml",
"defusedxml"]
readme = "README.md"
Expand Down
66 changes: 33 additions & 33 deletions scheduler.yaml_template
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,31 @@ default:
station:
- nrk
- bch

# schedule starts in 2 hours and covers 7 days
forward: 168
start: 2

# minimum observable pass length [minutes]
min_pass: 4

# URL for Aqua/Terra dump information
dump_url: "ftp://is.sci.gsfc.nasa.gov/ancillary/ephemeris/schedule/%s/downlink/"

pattern:
# dir/file pattern, follows rules of str.format()
# pre-set names:
# {date}, {time} : date+time
# {station} : as in station->name, for combined schedules ".comb" is appended,
# {date}, {time} : date+time
# {station} : as in station->name, for combined schedules ".comb" is appended,
# {mode} : request|report,
# {output_dir} : as in cmd-param --output-dir
dir_output: "{output_dir}/{date}-{time}"
dir_plots: "{dir_output}/plots.{station}"
file_xml: "{dir_output}/aquisition-schedule-{mode}_{station}.xml"
file_sci: "{dir_output}/scisys-schedule-{station}.txt"
file_graph: "{dir_output}/graph"
stations:

stations:
nrk:
name: nrk
# degrees east
Expand All @@ -39,16 +39,16 @@ stations:
altitude: 0.052765
area_file: /home/amaul/PyTROLL/etc/areas.def
area: euron1
satellites:
- metop-a
- metop-b
- noaa 19
- noaa 18
- noaa 15
- aqua
- terra
satellites:
- metop-a
- metop-b
- noaa 19
- noaa 18
- noaa 15
- aqua
- terra
- suomi npp

nrk-test:
name: nrk
# degrees east
Expand All @@ -59,7 +59,7 @@ stations:
altitude: 0.052765
area_file: /home/amaul/PyTROLL/etc/areas.def
area: euron1
satellites:
satellites:
metop-a :
night: 0.1
day: 0.6
Expand All @@ -72,7 +72,7 @@ stations:
aqua :
terra :
suomi npp :

bch:
name: bch
# degrees east
Expand All @@ -83,49 +83,49 @@ stations:
altitude: 0.14
area_file: /home/amaul/PyTROLL/etc/areas.def
area: euron1
satellites:
satellites:
- metop-a
- metop-b
- noaa 19
- noaa 18
- noaa 15
- aqua
- terra
- metop-b
- noaa 19
- noaa 18
- noaa 15
- aqua
- terra
- suomi npp

satellites:
metop-a:
night: 0.1
day: 0.6

metop-b:
night: 0.1
day: 0.6

noaa 19:
night: 0.05
day: 0.3

noaa 18:
night: 0.1
day: 0.6

noaa 16:
night: 0.1
day: 0.6

noaa 15:
night: 0.05
day: 0.3

aqua:
night: 0.2
day: 0.8

terra:
night: 0.2
day: 0.8

suomi npp:
night: 0.25
day: 0.9
Loading

0 comments on commit 472c1e0

Please sign in to comment.