Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
136 changes: 111 additions & 25 deletions pages/software.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

.. link:
.. description:
.. tags:
Expand All @@ -13,32 +14,35 @@ of our projects:
`SEP`_
------

SEP is a Python and C library for source detection and photometry,
adapted from the SourceExtractor code base. It makes the
SourceExtractor background and detection algorithms available directly
from Python and (eventually) Julia. `SEP on GitHub`_.
SEP is a Python and C library for source detection and photometry, adapted from the SourceExtractor code base. It makes the SourceExtractor background and detection algorithms available directly from Python and (eventually) Julia.

====
Links:

.. image:: /images/sncosmo.png
:height: 40px
:align: left
- http://sep.readthedocs.org
- http://github.com/kbarbary/sep

====

`SNCosmo`_
----------

SNCosmo is a Python package for supernova cosmology data analysis and
simulation. `SNCosmo on GitHub`_.
SNCosmo is a Python package for supernova cosmology data analysis and simulation.

====
Links:

- http://sncosmo.github.io
- http://github.com/sncosmo/sncosmo

====

`Dierckx.jl`_
-------------

Dierckx.jl is a package for 1-d and 2-d splines in Julia. It's a
wrapper of the dierckx Fortran library available from NETLIB, the same
library underlying the spline classes in scipy.interpolate.
Dierckx.jl is a package for 1-d and 2-d splines in Julia. It's a wrapper of the dierckx Fortran library available from NETLIB, the same library underlying the spline classes in scipy.interpolate.

Links:

- http://github.com/kbarbary/Dierckx.jl

====

Expand All @@ -47,20 +51,31 @@ library underlying the spline classes in scipy.interpolate.

cosmoxi2d provides theoretical predictions for the two-dimensional galaxy correlation function. This code was used to analyze `DR9 <http://adsabs.harvard.edu/abs/2012MNRAS.426.2719R>`_, `DR10, and DR11 <http://adsabs.harvard.edu/abs/2014MNRAS.439.3504S>`_ the SDSS-III BOSS CMASS galaxy sample and derive cosmological constraints on the geometry of the universe and the growth rate of cosmic structure.

Links:

- https://github.com/bareid/cosmoxi2d

====

`kdcount`_
----------

kdcount is a simple python extension for brute force pair-counting of point data sets. Pair-counting is the fundamental of estimating correlation functions from imaging and spectroscopy survey catalogues of quasars, galaxies, and Lyman-alpha forest.

Links:

- https://github.com/rainwoodman/kdcount

====

`pypm`_
-------

pypm is a set of python modules for particle mesh calculation with MPI parallel python. It also provides tools
to measure power spectrum, and construct Friend-of-Friend halso from n-body simulations.
pypm is a set of python modules for particle mesh calculation with MPI parallel python. It also provides tools to measure power spectrum, and construct Friend-of-Friend halso from n-body simulations.

Links:

- https://github.com/rainwoodman/pypm

====

Expand All @@ -69,13 +84,84 @@ to measure power spectrum, and construct Friend-of-Friend halso from n-body simu

pfft-python is a thin python extension layer of the massively parallel faster fourier transformation library, PFFT. Fast Fourier Transform is the core component of Particle-Mesh based gravity solvers, which simulate the formation of large scale structure, galaxies and dark matter halos.

.. _`Dierckx.jl`: http://github.com/kbarbary/Dierckx.jl
.. _`SEP`: http://sep.readthedocs.org
.. _`SEP on GitHub`: http://github.com/kbarbary/sep
.. _`SNCosmo`: http://sncosmo.github.io
.. _`SNCosmo on GitHub`: http://github.com/sncosmo/sncosmo
.. _`cosmoxi2d`: https://github.com/bareid/cosmoxi2d
.. _`kdcount`: https://github.com/rainwoodman/kdcount
.. _`pypm`: https://github.com/rainwoodman/pypm
.. _`pfft-python`: https://github.com/rainwoodman/pfft-python
Links:

- https://github.com/rainwoodman/pfft-python

====

`Copter`_
---------

a C++ class library written by Jordan Carlson to compute predictions for different cosmological perturbation theory schemes.

Links:

- http://mwhite.berkeley.edu/Copter/

====

`BoxRemap`_
-----------

a new technique to remap the cubical domain of a cosmological simulation into simple non-cubical shapes.

Links:

- http://mwhite.berkeley.edu/BoxRemap/

====

`ImagingLSS`_
-------------

Code for doing large-scale structure studies with the imaging data.

Links:

- http://github.com/desihub/imaginglss/

====

`LiteMangle`_
-------------

Light-weight library for some Mangle routines.

Links:

- http://github.com/martinjameswhite/litemangle

====

`mockFactory`_
--------------



Links:

- https://github.com/mockFactory

====

`CLPT_GSRSD`_
-------------

Convolution Lagrangian Perturbation Theory (CLPT) and Gaussian Streaming Redshift-Space Distortions (GSRSD)

Links:

- https://github.com/wll745881210/CLPT_GSRSD

====

`recon_code`_
-------------

Code to perform density field reconstruction for baryon acoustic oscillation (BAO) experiments

Links:

- https://github.com/martinjameswhite/recon_code

131 changes: 131 additions & 0 deletions software_to_json.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
"""
This simple script converts the current software.rst page to a json file.
"""
import json
import urllib2
import os
TOKEN = os.environ["GITHUB_OAUTH2_TOKEN"]

def buildjson():
with file('pages/software.rst', 'r') as ff:
lines = ff.readlines()

def parse(lines):
STARTED = 1
state = 0
for line in lines:
line = line.strip()
if len(line) == 0:
continue
if state < STARTED:
if line == '====':
state = STARTED
entry = {}
L = []
continue
else:
if line.startswith('---'):
entry['ProjectName'] = L[-1][1:-2]
L = []
continue
elif line.startswith('.. _'):
if 'Links' not in entry:
entry['Links'] = []
entry['Links'].append(line[line.index(':')+1:].strip())
continue
elif line == 'Links:':
continue
elif line.startswith('- http'):
if 'Links' not in entry:
entry['Links'] = []
entry['Links'].append(line[2:].strip())
continue
elif line == '====':
entry['Description'] = ' '.join(L)
yield entry
entry = {}
L = []
else:
L.append(line)
entry['Description'] = ' '.join(L)
yield entry

entries = [entry for entry in parse(lines) ]
with file('software.json', 'w') as ff:
json.dump(entries, ff, sort_keys=True,
indent=4, separators=(',', ': '))

def fixjson():
with file('software.json', 'r') as ff:
entries = json.load(ff)
class NotGithubURL(Exception): pass
def parse_github_url(url):
""" returns the :owner and :repo field """
if 'github.com' in url:
url = url.strip('/')
slashes = url.split('/')
if slashes[-2].endswith('github.com'):
# this is a org
return slashes[-1],
else:
return slashes[-2], slashes[-1]
else:
raise NotGithubURL("Not a Github URL");
for entry in entries:
if len(entry['Description'].strip()) == 0:
for url in entry['Links']:
try:
result = parse_github_url(url)
if len(result) == 2:
req = urllib2.Request("https://api.github.com/repos/%s/%s" % result)
elif len(result) == 1:
req = urllib2.Request("https://api.github.com/orgs/%s" % result)
else:
raise RuntimeError

req.add_header('Authorization', 'token %s' % TOKEN)
ff = urllib2.urlopen(req)
data = json.load(ff)
if data['description']:
entry['Description'] = data['description']
else:
pass
except NotGithubURL:
continue
with file('software.json', 'w') as ff:
json.dump(entries, ff, sort_keys=True,
indent=4, separators=(',', ': '))

def buildrst():
header="""
.. link:
.. description:
.. tags:
.. date: 2014/02/08 12:19:51
.. title: Software
.. slug: software

BCCP develops open-source software for use in cosmology. Here are some
of our projects:

"""
with file('software.json', 'r') as ff:
entries = json.load(ff)
with file('software.rst', 'w') as ff:
ff.write(header)
for entry in entries:
ff.write('====\n\n')
ff.write('`%s`_\n' % entry['ProjectName'])
ff.write('-' * (len(entry['ProjectName']) + 3))
ff.write('\n\n')
ff.write('%s\n\n' % entry['Description'])
if len(entry['Links']) > 0:
ff.write('Links:\n\n')
for link in entry['Links']:
ff.write('- %s\n' % link)
ff.write('\n')

# these really should be subcommands!
buildjson()
fixjson()
buildrst()