Skip to content

Commit

Permalink
Ensure that PROSPECT spectra are stored in library
Browse files Browse the repository at this point in the history
I think the PROSPECT spectra are now distributed with the library.
Addresses #11, @MarcYin can you please test? Thanks!
  • Loading branch information
Jose Gomez-Dans committed Oct 12, 2018
1 parent 2a8c8e0 commit 58d99dc
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 5 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
recursive-include prosail/ *.txt
6 changes: 6 additions & 0 deletions prosail/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
#!/usr/bin/env python
__author__ = "J Gomez-Dans"
__copyright__ = "Copyright 2017, 2018 J Gomez-Dans"
__version__ = "2.0.2"
__license__ = "GPLv3"
__email__ = "j.gomez-dans@ucl.ac.uk"

from .spectral_library import get_spectra
spectral_lib = get_spectra()
from .prospect_d import run_prospect
Expand Down
4 changes: 2 additions & 2 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package:
name: prosail
version: 2.0.1-1
version: 2.0.2

source:
git_tag: 2.0.1-1
git_tag: 2.0.2
git_url: http://github.com/jgomezdans/prosail.git

requirements:
Expand Down
27 changes: 24 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,39 @@
#!/usr/bin/env python
"""Setup script for building prosail's python bindings"""
from setuptools import setup
import os
import codecs
import re
from os import path
from setuptools import setup

# Global variables for this extension:
name = "prosail" # name of the generated python extension (.so)
description = "PROSPECT, SAIL and PROSAIL Python wrappers"
long_description = "The PROSPECT + SAILh radiative transfer models from Python"

this_directory = path.abspath(path.dirname(__file__))

def read(filename):
with open(os.path.join(os.path.dirname(__file__), filename), "rb") as f:
with open(os.path.join(this_directory, filename), "rb") as f:
return f.read().decode("utf-8")


if os.path.exists("README.md"):
long_description = read("README.md")

def read(*parts):
with codecs.open(os.path.join(this_directory, *parts), 'r') as fp:
return fp.read()

def find_version(*file_paths):
version_file = read(*file_paths)
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
version_file, re.M)
if version_match:
return version_match.group(1)
raise RuntimeError("Unable to find version string.")


author = "J Gomez-Dans/NCEO & University College London"
author_email = "j.gomez-dans@ucl.ac.uk"
url = "http://github.com/jgomezdans/prosail"
Expand All @@ -35,6 +53,9 @@ def read(filename):
'Environment :: Console'
]




setup(
name=name,
description=description,
Expand All @@ -52,7 +73,7 @@ def read(filename):
"scipy",
"pytest",
],
version="2.0.1-1",
version=find_version("prosail", "__init__.py"),
packages=["prosail"],
zip_safe=False # Apparently needed for conda
)

0 comments on commit 58d99dc

Please sign in to comment.