diff --git a/pages/software.rst b/pages/software.rst index f27ca67..9174630 100644 --- a/pages/software.rst +++ b/pages/software.rst @@ -1,3 +1,4 @@ + .. link: .. description: .. tags: @@ -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 ==== @@ -47,6 +51,10 @@ 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 `_, `DR10, and DR11 `_ 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`_ @@ -54,13 +62,20 @@ cosmoxi2d provides theoretical predictions for the two-dimensional galaxy correl 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 ==== @@ -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 diff --git a/software_to_json.py b/software_to_json.py new file mode 100644 index 0000000..19c3a1b --- /dev/null +++ b/software_to_json.py @@ -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()