Skip to content

Commit

Permalink
Merge pull request #165 from rbiswas4/releaseBeforeDC2
Browse files Browse the repository at this point in the history
Fixed README and added other things required for release
  • Loading branch information
rbiswas4 authored Jan 14, 2018
2 parents 83f9ff1 + 1d555ea commit b35dbc8
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 24 deletions.
26 changes: 8 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,19 @@ Tools for summarizing the LSST Operations Simulations outputs for use with catal

[![Build Status](https://travis-ci.org/rbiswas4/OpSimSummary.svg?branch=master)](https://travis-ci.org/rbiswas4/OpSimSummary)
- documentation is hosted at [github_pages](https://rbiswas4.github.io/OpSimSummary)
# Requirements
- python 2.7 or 3.5
- pandas
- numpy
- sqlalchemy
- ipython notebook (only to run example files)
- healpy (also installed by lsst.sims.maf)
- lsst.sims.maf (The example can be run, if you already know the propID corresponding to the proposal you want)
- basemap: can be installed from conda https://anaconda.org/conda-forge/basemap

Everything other than lsst.sims.maf is part of the anaconda python distribution and available on pip. For lsst.sims.maf installation instructions, see the confluence page.
# Running
- Assuming you have miniconda installed,
you can install the code and its dependencies for the current user by
# Installation
`opsimsummary` runs on either python 2.7 or 3.5+ . The list of required software to run `opsimsummary` is listed [here](./install/requirements.md). Assuming miniconda is already installed, `opsimsummary` can be installedalong with its dependencies for the current user by
```
./install/install_all.sh
```
If you have the dependecies installed, you can install the code only by running
and it will install dependencies from conda channels or use pip.
If the dependecies [listed](./install/requirements.md) are already installed, `opsimsummary` can be installed by running
```
.install/install_opsimsummary.sh
./install/install_opsimsummary.sh
```

Obviously, running the commands in the scripts will also allow the user to achieve the same results.

(The --user argument only installs this for the user only, leaving that out will install for all users on the computer if you have appropriate permissions)

- open the examples/ExampleSimlib.ipynb notebook and execute cells with shift+enter
# Running
- open the `examples/Demo_OpSimOutput.ipynb` and execute the cells.
2 changes: 1 addition & 1 deletion install/pip-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ python-coveralls
coverage
matplotlib
sqlalchemy

pyproj
13 changes: 13 additions & 0 deletions install/requirements.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Required Packages beyond miniconda install
- pytest
- future
- pytest-cov
- python-coveralls
- coverage
- matplotlib
- sqlalchemy
- pyproj
- healpy
- basemap
- scikit-learn
- pandas
4 changes: 3 additions & 1 deletion opsimsummary/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
example_data = os.path.join(basedir, 'example_data')
try:
from .visualization import *
except ImportError:
except ImportError as e:
print('Some imports failed, which implies some dependencies are missing as described below')
print(e)
print('Visulization functions based on maps will not work')
pass
2 changes: 1 addition & 1 deletion opsimsummary/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__VERSION__ = "1.3.1"
__VERSION__ = "1.3.3"
12 changes: 9 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
from distutils.core import setup
from setuptools import setup
import sys
import os
import re

PACKAGENAME = 'opsimsummary'
packageDir = os.path.join(os.path.dirname(os.path.abspath(__file__)),
PACKAGENAME)
versionFile = os.path.join(packageDir, 'version.py')

# Obtain the package version

versionFile = os.path.join(packageDir, 'version.py')
with open(versionFile, 'r') as f:
s = f.read()
# Look up the string value assigned to __version__ in version.py using regexp
versionRegExp = re.compile("__VERSION__ = \"(.*?)\"")
# Assign to __version__
__version__ = versionRegExp.findall(s)[0]
print(__version__)

# create requirements file
setupDir = os.path.join(packageDir, '..', 'setup')
genRequirements = os.path.join(setupDir, 'generate_requirements.py')



setup(# package information
name=PACKAGENAME,
version=__version__,
Expand Down
13 changes: 13 additions & 0 deletions setup/generate_requirements.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
lines = []
with open('install/pip-requirements.txt', 'r') as f:
lines = f.read()

with open('install/conda_requirements.txt', 'r') as f:
lines += f.read()

res = (list('- ' + l +'\n' for l in lines.split('\n')))

with open ('install/requirements.md', 'wb') as f:
f.write('# Required Packages beyond miniconda install\n')
for l in res[:-1]:
f.write(l)

0 comments on commit b35dbc8

Please sign in to comment.