Skip to content
This repository has been archived by the owner on Dec 7, 2018. It is now read-only.

New sampler API #70

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

New sampler API #70

wants to merge 3 commits into from

Conversation

cdcapano
Copy link
Collaborator

@cdcapano cdcapano commented Aug 22, 2018

This is a PR to track differences between the new_sampler_api branch and master. Any PRs merged onto the new_sampler_api branch will automatically be picked up in this PR. Once we are happy that the changes are ready to be merged on to master, it should be merged through this PR.

So far this branch includes PR #68. In no particular order, things left to do are:

  • Add an IO class for posterior files and update gwin_extract_samples.
  • Update plotting scripts.
  • Update emcee_pt.
  • Update kombine.
  • Update mcmc.
  • Fix unit tests.
  • Update documentation.

New samplers may also be added in this PR to test the flexibility of the new API, but that's not a requirement before this can be merged to master.

* start InferenceFile -> BaseInferenceFile

* rename hdf.py base_hdf.py

* add parse_parameters function

* add module for base mcmc io

* make _read_samples_data the abstract method

* added read_samples_data to base_mcmc

* add emcee file handling

* replace read/write functions with io in BaseSampler

* add checkpoint requirement; rename samples raw_samples

* start updating emcee

* move emcee_pt to it's own module

* add base_mcmc (needs work)

* start changing the base sampler api

* add write_metadata to models

* move setting up checkpoint and run interval to sampler methods

* rearrange read/write functions; add checkpoint and finalize methods; add run method to base_mcmc

* fix whitespace

* add acl support

* update executable

* add finalize to emcee, fix typos

* change write_posterior to expect filename, not file

* change burn in module to just have functions

* start to define burn in support class

* move burn in class to burn_in module; add evaluate

* add write burn in to io

* add from_config for burn-in class

* more support for burn-in, calculation of independent samples

* add thin_start/interval/end to the hdf file attrs

* fix typos, whitespace in burn_in

* fix whitespace, typos in base_hdf

* rename EnsembleMCMCIO to MCMCIO; fix whitespace

* fix typo

* fix whitespace

* write filetype to inference hdf files; provide a loadfile function

* fix some import errors

* remove sampler_class from io to avoid circular imports

* fix bugs

* fix bugs, move niterations/nsamples into config file

* add halfchain, posterior_step, min_iterations back to burn_in

* fix bugs to get acl working post burn in

* fix bugs in nacl burn in test

* write more information to the logging messages

* fix bugs in min_iterations burn-in test

* fix more bugs

* fix pep8 issues

* fix bugs for running with data

* whitespace
@cdcapano cdcapano added this to the 0.1.0 milestone Aug 22, 2018
@cdcapano cdcapano requested a review from cmbiwer as a code owner August 22, 2018 09:12
@cdcapano cdcapano added this to Work in progress in Update sampler API Aug 22, 2018
@cdcapano cdcapano added pr:backwards-incompatible Backwards-incompatible change (major version bump) gwin.sampler Change to gwin.sampler sub-package labels Aug 22, 2018
* move results from cli functions to io module; add ability to specify different options for different input files

* make write_kwargs_to_attrs a classmethod to cyclic imports

* use argparse action to parse parameters option

* move injections_from_cli to __init__; add a read_injections method to base_hdf

* use parameters opt to load parameters in base_mcmc

* move get_file_type to io; fix bugs

* fix import error

* create a custom ArgumentParser

* allow input-file option to accept labels

* move param parsing to option_utils and remove unused functions

* update create_multidim plot

* update plot_posterior

* switch from normed to density to please matplotlib

* update plot_posterior

* fix plotting injection parameters

* move thin options to base_mcmc; add ability to skip arguments

* update plot_movie

* fix pep8 issues
@pep8speaks
Copy link

pep8speaks commented Sep 25, 2018

Hello @cdcapano! Thanks for updating the PR.

file_to_check.py:421:-92: W605 invalid escape sequence '*'


Line 45:1: E302 expected 2 blank lines, found 1

  • Complete extra results for this file :

file_to_check.py:107:-81: W605 invalid escape sequence '*'
file_to_check.py:178:-188: W605 invalid escape sequence '*'
file_to_check.py:212:-90: W605 invalid escape sequence '*'
file_to_check.py:252:-492: W605 invalid escape sequence '*'
file_to_check.py:280:-457: W605 invalid escape sequence '*'
file_to_check.py:312:-244: W605 invalid escape sequence '*'
file_to_check.py:777:-48: W605 invalid escape sequence '*'


  • There are no PEP8 issues in the file gwin/io/base_mcmc.py !

  • Complete extra results for this file :

file_to_check.py:190:-336: W605 invalid escape sequence '*'


file_to_check.py:167:-207: W605 invalid escape sequence '*'


  • There are no PEP8 issues in the file gwin/models/base.py !

  • Complete extra results for this file :

file_to_check.py:491:-177: W605 invalid escape sequence '*'
file_to_check.py:531:-228: W605 invalid escape sequence '*'
file_to_check.py:614:-186: W605 invalid escape sequence '*'
file_to_check.py:734:-159: W605 invalid escape sequence '*'


file_to_check.py:211:-159: W605 invalid escape sequence '*'


Line 745:80: E501 line too long (82 > 79 characters)

file_to_check.py:57:-188: W605 invalid escape sequence '*'


  • There are no PEP8 issues in the file gwin/sampler/base.py !

  • Complete extra results for this file :

file_to_check.py:223:-119: W605 invalid escape sequence '*'


file_to_check.py:157:-86: W605 invalid escape sequence '*'


file_to_check.py:202:-86: W605 invalid escape sequence '*'


Comment last updated on September 25, 2018 at 10:29 Hours UTC

* fix a bug in base_mcmc hdf and add docs

* fix docs in emcee io

* add global call method for logprior

* add base_multitemper sampler methods and io

* move some config loading to base_mcmc

* remove unnecessary import

* add support for multi tempered samplers to burn_in

* update emcee_pt

* add imports to module __init__s

* remove note from executable

* add emcee_pt to io

* fix import errors

* make sure stats are written out with the correct dtype

* fix bugs

* fix more bugs

* create an action for parsing temps arg

* make sure fields is a list

* fix pep8 issues
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
gwin.sampler Change to gwin.sampler sub-package pr:backwards-incompatible Backwards-incompatible change (major version bump) work in progress
Projects
Update sampler API
  
Work in progress
Development

Successfully merging this pull request may close these issues.

None yet

7 participants