Skip to content

Commit 4fd7637

Browse files
authored
Merge pull request #103 from pysat/rc_v0.0.8
Release Candidate v0.0.8
2 parents dd164e9 + 5a5db9c commit 4fd7637

22 files changed

Lines changed: 1287 additions & 453 deletions

.github/workflows/docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ jobs:
1616

1717
name:
1818
steps:
19-
- uses: actions/checkout@v2
19+
- uses: actions/checkout@v3
2020
- name: Set up Python ${{ matrix.python-version }}
21-
uses: actions/setup-python@v2
21+
uses: actions/setup-python@v4
2222
with:
2323
python-version: ${{ matrix.python-version }}
2424

.github/workflows/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ jobs:
1616
numpy_ver: [latest]
1717
include:
1818
- python-version: "3.8"
19-
numpy_ver: "1.19"
19+
numpy_ver: "1.20.3"
2020
os: ubuntu-latest
2121

2222
name: Python ${{ matrix.python-version }} on ${{ matrix.os }} with numpy ${{ matrix.numpy_ver }}
2323
runs-on: ${{ matrix.os }}
2424
steps:
25-
- uses: actions/checkout@v2
25+
- uses: actions/checkout@v3
2626
- name: Set up Python ${{ matrix.python-version }}
27-
uses: actions/setup-python@v2
27+
uses: actions/setup-python@v4
2828
with:
2929
python-version: ${{ matrix.python-version }}
3030

@@ -37,7 +37,7 @@ jobs:
3737
- name: Install NEP29 dependencies
3838
if: ${{ matrix.numpy_ver != 'latest'}}
3939
run: |
40-
pip install --no-binary :numpy: numpy==${{ matrix.numpy_ver }}
40+
pip install numpy==${{ matrix.numpy_ver }}
4141
4242
- name: Set up pysat
4343
run: |

.github/workflows/pysat_rc.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Test with latest pysat RC
5+
6+
on: [workflow_dispatch]
7+
8+
jobs:
9+
build:
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
os: [ubuntu-latest, macos-latest, windows-latest]
14+
python-version: ["3.10"]
15+
16+
name: Python ${{ matrix.python-version }} on ${{ matrix.os }}
17+
runs-on: ${{ matrix.os }}
18+
steps:
19+
- uses: actions/checkout@v3
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
25+
- name: Install pysat RC
26+
run: pip install --no-deps -i https://test.pypi.org/simple/ pysat
27+
28+
- name: Install standard dependencies
29+
run: |
30+
pip install -r requirements.txt
31+
pip install -r test_requirements.txt
32+
33+
- name: Set up pysat
34+
run: |
35+
mkdir pysatData
36+
python -c "import pysat; pysat.params['data_dirs'] = 'pysatData'"
37+
38+
- name: Test with pytest
39+
run: pytest -vs --cov=pysatSpaceWeather/
40+
41+
- name: Publish results to coveralls
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
run: coveralls --rcfile=setup.cfg --service=github

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,28 @@ Change Log
33
All notable changes to this project will be documented in this file.
44
This project adheres to [Semantic Versioning](https://semver.org/).
55

6+
[0.0.8] - 2022-11-29
7+
--------------------
8+
* Bugs
9+
* Fixed F10.7 prelim and daily metadata to allow the fill value to keep the
10+
same type as the data
11+
* Maintenance
12+
* Updated the GitHub action version numbers
13+
* Updated syntax for pysat instrument testing suite
14+
* Remove deprecated pytest syntax (backwards support for nose)
15+
* Removed deprecated pandas syntax (iteritems)
16+
* Added Github action workflow using the latest pysat RC
17+
* Added new tags for the sw_kp instrument's GFZ data, 'def' and 'now', to
18+
replace ''
19+
620
[0.0.7] - 2022-09-15
721
--------------------
822
* Updated `sw_f107` to allow reading old and new `historic` data file format
923
* Added exampled to the documentation for F10.7 and Kp methods
24+
* Captured JSON error in historic F10.7 downloads and wrapped it with a logger
25+
message informing the user that their date may not be in the database
26+
* Removed warning for not using the deprecated `freq` kwarg
27+
* Removed deprecated function `load_csv_data`
1028

1129
[0.0.6] - 2022-07-08
1230
--------------------

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@
5959
project = 'pysatSpaceWeather'
6060
title = '{:s} Documentation'.format(project)
6161
zenodo = json.loads(open('../.zenodo.json').read())
62-
author = ', '.join([x['name'] for x in zenodo['creators']])
62+
author = ', '.join([auth['name'] for auth in zenodo['creators']])
6363
description = 'Tools for space weather indices.'
64-
copyright = ', '.join(['2021', author])
64+
copyright = ', '.join(['2022', author])
6565

6666
# The version info for the project you're documenting, acts as replacement for
6767
# |version| and |release|, also used in various other places throughout the

docs/examples/ex_f107.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ This may be done using the
2727
tag='45day', update_files=True)
2828

2929
# If needed, download the data
30-
f107_hist.download(start=f107_hist.lasp_stime, stop=dt.datetime(2018, 4, 1),
31-
freq='MS')
30+
f107_hist.download(start=f107_hist.lasp_stime, stop=dt.datetime(2018, 4, 1))
3231
f107_prel.download(start=f107_hist.files.files.index[-1],
3332
stop=f107_prel.today())
3433
f107_fore.download(start=f107_fore.today())

docs/examples/ex_init.rst

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ used as an example.
1818

1919
f107 = pysat.Instrument(inst_module=py_sw.instruments.sw_f107,
2020
tag='historic', update_files=True)
21-
f107.download(start=f107.lasp_stime, stop=f107.today(), freq='MS')
21+
f107.download(start=f107.lasp_stime, stop=f107.today())
2222
f107.load()
23-
print(f107)
23+
print(f107.data)
2424

2525

2626
The output includes all available historic data (as implied by the tag name),
@@ -32,18 +32,18 @@ output shown below (the index header has been added here for clarity).
3232
::
3333

3434

35-
<Index> f107
36-
1947-02-14 253.9
37-
1947-02-17 228.5
38-
1947-02-19 178.8
39-
1947-02-20 163.7
40-
1947-02-24 164.1
41-
... ...
42-
2018-04-27 69.6
43-
2018-04-28 71.1
44-
2018-04-29 72.2
45-
2018-04-30 71.3
35+
<Index> f107 f107_adjusted f107_observed
36+
1947-02-14 253.9 253.9 NaN
37+
1947-02-17 228.5 228.5 NaN
38+
1947-02-19 178.8 178.8 NaN
39+
1947-02-20 163.7 163.7 NaN
40+
1947-02-24 164.1 164.1 NaN
41+
... ... ... ...
42+
2018-04-27 69.6 69.6 68.7
43+
2018-04-28 71.1 71.1 70.2
44+
2018-04-29 72.2 72.2 71.1
45+
2018-04-30 71.3 71.3 70.2
4646
47-
[25367 rows x 1 columns]
47+
[25367 rows x 3 columns]
4848

4949

docs/examples/ex_kp.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ different time periods. This may be done using the
1919
import pysatSpaceWeather as py_sw
2020

2121
kp_his = pysat.Instrument(inst_module=py_sw.instruments.sw_kp,
22-
tag='', update_files=True)
22+
tag='def', update_files=True)
2323
kp_rec = pysat.Instrument(inst_module=py_sw.instruments.sw_kp,
2424
tag='recent', update_files=True)
2525
kp_for = pysat.Instrument(inst_module=py_sw.instruments.sw_kp,
@@ -91,7 +91,7 @@ converts Kp to ap, as shown below.
9191
9292
py_sw.instruments.methods.kp_ap.convert_3hr_kp_to_ap(kp)
9393

94-
print("Max: {:.1f} -> {:d}, Min: {:.1f} -> {:d}".format(
94+
print("Max: {:.1f} -> {:.1f}, Min: {:.1f} -> {:.1f}".format(
9595
kp['Kp'].max(), kp['3hr_ap'].max(), kp['Kp'].min(), kp['3hr_ap'].min()))
9696

9797
This yields ``Max: 9.0 -> 400.0, Min: 0.0 -> 0.0``.

pysatSpaceWeather/instruments/methods/ace.py

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import os
1212
import pandas as pds
1313
import requests
14-
import warnings
1514

1615
import pysat
1716

@@ -300,54 +299,6 @@ def common_metadata():
300299
return meta, status_desc
301300

302301

303-
def load_csv_data(fnames, read_csv_kwargs=None):
304-
"""Load CSV data from a list of files into a single DataFrame.
305-
306-
.. deprecated:: 0.0.5
307-
`load_csv_data` will be removed in pysatSpaceWeather 0.0.6+, as it has
308-
been moved to `pysat.instruments.methods.general` as of pysat 3.0.1.
309-
310-
Parameters
311-
----------
312-
fnames : array-like
313-
Series, list, or array of filenames
314-
read_csv_kwargs : dict or NoneType
315-
Dict of kwargs to apply to `pds.read_csv`. (default=None)
316-
317-
Returns
318-
-------
319-
data : pds.DataFrame
320-
Data frame with data from all files in the fnames list
321-
322-
See Also
323-
--------
324-
pds.read_csv, pysat.instruments.methods.general.load_csv_data
325-
326-
"""
327-
328-
warnings.warn("".join(["Moved to pysat.instruments.methods.general.",
329-
"load_csv_data in pysat version 3.0.1. This method ",
330-
"will be removed at the 0.0.6+ release."]),
331-
DeprecationWarning)
332-
333-
# Ensure the filename input is array-like
334-
fnames = np.asarray(fnames)
335-
if fnames.shape == ():
336-
fnames = np.asarray([fnames])
337-
338-
# Initialize the optional kwargs
339-
if read_csv_kwargs is None:
340-
read_csv_kwargs = {}
341-
342-
# Create a list of data frames from each file
343-
fdata = []
344-
for fname in fnames:
345-
fdata.append(pds.read_csv(fname, **read_csv_kwargs))
346-
347-
data = pds.DataFrame() if len(fdata) == 0 else pds.concat(fdata, axis=0)
348-
return data
349-
350-
351302
def ace_swepam_hourly_omni_norm(as_inst, speed_key='sw_bulk_speed',
352303
dens_key='sw_proton_dens',
353304
temp_key='sw_ion_temp'):

pysatSpaceWeather/instruments/methods/f107.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def combine_f107(standard_inst, forecast_inst, start=None, stop=None):
145145
f107_inst.inst_module = pysat_sw.instruments.sw_f107
146146
f107_inst.tag = tag
147147
f107_inst.date = start
148-
f107_inst.doy = int(start.strftime("%j"))
148+
f107_inst.doy = np.int64(start.strftime("%j"))
149149
fill_val = None
150150

151151
f107_times = list()
@@ -326,7 +326,7 @@ def parse_45day_block(block_lines):
326326
for tt in split_line[::2]])
327327

328328
# Format the data values
329-
values.extend([int(vv) for vv in split_line[1::2]])
329+
values.extend([np.int64(vv) for vv in split_line[1::2]])
330330

331331
return dates, values
332332

@@ -428,7 +428,7 @@ def parse_daily_solar_data(data_lines, year, optical):
428428
if val == "*":
429429
val = -999 if i < 5 else -1
430430
else:
431-
val = int(val)
431+
val = np.int64(val)
432432
values[kk].append(val)
433433

434434
return dates, values

0 commit comments

Comments
 (0)