summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorUniversebenzene2023-04-29 19:07:27 +0800
committerUniversebenzene2023-04-29 19:07:27 +0800
commit213dc82cbb41b75af0ad13a57d04cbf6d04cf823 (patch)
tree562f2a1128015774f3d421f6f19c9dad73c9f715
parent1645a958e985d4e7e2f98fb05714588b4afe6417 (diff)
downloadaur-213dc82cbb41b75af0ad13a57d04cbf6d04cf823.tar.gz
Update to version 2.10.0
-rw-r--r--.SRCINFO14
-rw-r--r--.gitignore2
-rw-r--r--PKGBUILD19
-rw-r--r--doc-use-local-data.patch25
4 files changed, 52 insertions, 8 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 114a3403d6d2..d6e1486d2416 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,17 +1,23 @@
pkgbase = python-sncosmo-doc
pkgdesc = Documentation for SNCosmo
- pkgver = 2.9.0
+ pkgver = 2.10.0
pkgrel = 1
url = https://sncosmo.readthedocs.io
arch = any
license = BSD
- makedepends = python-sncosmo=2.9.0
+ makedepends = python-sncosmo=2.10.0
makedepends = python-numpydoc
makedepends = python-sphinx_rtd_theme
makedepends = python-sphinx-gallery
makedepends = python-iminuit
makedepends = graphviz
- source = https://github.com/sncosmo/sncosmo/archive/v2.9.0.tar.gz
- md5sums = e98a9fd0ca006e14640c7167933a801c
+ source = https://github.com/sncosmo/sncosmo/archive/v2.10.0.tar.gz
+ source = https://c3.lbl.gov/nugent/templates/sn1a_flux.v1.2.dat.gz
+ source = https://c3.lbl.gov/nugent/templates/sn2p_flux.v1.2.dat.gz
+ source = doc-use-local-data.patch
+ md5sums = 088188d5e3c19f220eaa8b48a3ae5d2a
+ md5sums = 86a80d4b02030abbeb9941131053082a
+ md5sums = 121927c70484bf2f11298465210fc1a1
+ md5sums = f277218e6347977f675dada2ad5859ee
pkgname = python-sncosmo-doc
diff --git a/.gitignore b/.gitignore
index e896dcd6056d..78aea2818723 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,7 +1,7 @@
src
pkg
*.src.tar.gz
-*.tar.gz
+*.gz
*.tar.bz2
*.part
*.pkg.tar.*
diff --git a/PKGBUILD b/PKGBUILD
index 89b6d5a1954f..00ba514a5153 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,7 +1,7 @@
# Maintainer: Astro Benzene <universebenzene at sina dot com>
_pyname=sncosmo
pkgname=python-${_pyname}-doc
-pkgver=2.9.0
+pkgver=2.10.0
pkgrel=1
pkgdesc="Documentation for SNCosmo"
arch=('any')
@@ -13,8 +13,21 @@ makedepends=("python-${_pyname}=${pkgver}"
'python-sphinx-gallery'
'python-iminuit'
'graphviz')
-source=("https://github.com/sncosmo/sncosmo/archive/v${pkgver}.tar.gz")
-md5sums=('e98a9fd0ca006e14640c7167933a801c')
+source=("https://github.com/sncosmo/sncosmo/archive/v${pkgver}.tar.gz"
+ "https://c3.lbl.gov/nugent/templates/sn1a_flux.v1.2.dat.gz"
+ "https://c3.lbl.gov/nugent/templates/sn2p_flux.v1.2.dat.gz"
+ 'doc-use-local-data.patch')
+md5sums=('088188d5e3c19f220eaa8b48a3ae5d2a'
+ '86a80d4b02030abbeb9941131053082a'
+ '121927c70484bf2f11298465210fc1a1'
+ 'f277218e6347977f675dada2ad5859ee')
+
+prepare() {
+ cd ${srcdir}/${_pyname}-${pkgver}
+
+ cp ${srcdir}/*flux.v1.2.dat docs/_examples
+ patch -Np1 -i "${srcdir}/doc-use-local-data.patch"
+}
build() {
cd ${srcdir}/${_pyname}-${pkgver}/docs
diff --git a/doc-use-local-data.patch b/doc-use-local-data.patch
new file mode 100644
index 000000000000..ac1a6606dbea
--- /dev/null
+++ b/doc-use-local-data.patch
@@ -0,0 +1,25 @@
+--- a/docs/_examples/plot_custom_source.py 2023-04-27 23:07:04.000000000 +0800
++++ b/docs/_examples/plot_custom_source.py 2023-04-29 18:24:35.212710056 +0800
+@@ -65,11 +65,18 @@
+ # sncosmo to download the Nugent Ia and 2p templates. Don't rely on this
+ # the `DATADIR` object, or these paths in your code though, as these are
+ # subject to change between version of sncosmo!
++# Use local data if download failed:
+ from sncosmo.builtins import DATADIR
+-phase1, wave1, flux1 = sncosmo.read_griddata_ascii(
+- DATADIR.abspath('models/nugent/sn1a_flux.v1.2.dat'))
+-phase2, wave2, flux2 = sncosmo.read_griddata_ascii(
+- DATADIR.abspath('models/nugent/sn2p_flux.v1.2.dat'))
++try:
++ phase1, wave1, flux1 = sncosmo.read_griddata_ascii(
++ DATADIR.abspath('models/nugent/sn1a_flux.v1.2.dat'))
++except Exception:
++ phase1, wave1, flux1 = sncosmo.read_griddata_ascii('sn1a_flux.v1.2.dat')
++try:
++ phase2, wave2, flux2 = sncosmo.read_griddata_ascii(
++ DATADIR.abspath('models/nugent/sn2p_flux.v1.2.dat'))
++except Exception:
++ phase2, wave2, flux2 = sncosmo.read_griddata_ascii('sn2p_flux.v1.2.dat')
+
+ # In our __init__ method we defined above, the two fluxes need to be on
+ # the same grid, so interpolate the second onto the first: