Skip to content

Commit

Permalink
fixes for v2.3.0
Browse files Browse the repository at this point in the history
touched up readme for both PyPI and GH
updated release notes
updated doc
updated usage guide
checked that tests ran fine
  • Loading branch information
eltrompetero committed May 12, 2020
1 parent 08eca45 commit 0d48825
Show file tree
Hide file tree
Showing 32 changed files with 3,776 additions and 162 deletions.
27 changes: 12 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

# Convenient Interface to Inverse Ising

**ConIII is now on version 2. Major interface updates may break code compatibility. See
[release notes](https://github.com/eltrompetero/coniii/blob/py3/RELEASE_NOTES "release
notes").**
**ConIII is now on version 2. Major interface updates may break code compatibility from
version 1. See [release
notes](https://github.com/eltrompetero/coniii/blob/py3/RELEASE_NOTES "release notes").**

ConIII is a Python package for solving maximum entropy problems with a focus on the
pairwise maximum entropy model, also known as the inverse Ising problem. Support for
Python 3.7.4 and higher only.
Python 3.7.5 and higher.

If you use ConIII for your research, please consider citing the following:
> Lee, E.D. and Daniels, B.C., 2019. Convenient Interface to Inverse Ising (ConIII): A
> Python 3 Package for Solving Ising-Type Maximum Entropy Models. Journal of Open Research
> Software, 7(1), p.3. DOI: http://doi.org/10.5334/jors.217.
The paper also contains an overview of the module. For code documentation, see
The paper also contains an overview of the modules. For code documentation, see
[here](https://eddielee.co/coniii/index.html "Documentation").

## Installation
Expand All @@ -27,9 +27,9 @@ $ pip install coniii
We highly recommend the use of virtual environments as supported through Anaconda to
manage this package and associated ones that need to be installed.

If you have trouble using `pip` and PyPI, then you can always build this package from
If you have trouble using `pip`, then you can always build this package from
source. Download the latest release from GitHub. Make sure that you are running Python
3.7 or higher. Inside the top directory "coniii", you must run
3.7.5 or higher. Inside the top directory "coniii", you must run
```bash
$ ./pypi_compile.sh
$ pip install dist/*.whl
Expand Down Expand Up @@ -66,7 +66,7 @@ variable to include this path. Alternatively, you can modify the environment pat
variables LIBRARY_PATH and LD_LIBRARY_PATH. For a few more hints, see DEVREADME or open an
issue!

#### Setting up analytic solution for systems *N > 9*
#### Setting up exact solution for systems *N > 9*
If you would like to use the `Enumerate` solver for system sizes greater than 9 spins, you
must run enumerate.py to write those files yourself. This can be run from the install
directory. If you do not know where the installation directory is, you can find it by
Expand All @@ -88,9 +88,9 @@ for the Ising model in the {0,1} basis. On the other hand,
$ python enumerate.py [N] 1
```

specifies that the system should be written for the {-1,1} basis. Note that the solver
uses the {-1,1} basis. For more details, see the `__main__` block at the end of the file
enumerate.py.
specifies that the system should be written for the {-1,1} basis. Note that the package
uses the {-1,1} basis by default. For more details, see the `__main__` block at the end of
the file enumerate.py.

## Quick guide (with Jupyter notebook)

Expand Down Expand Up @@ -157,7 +157,7 @@ $ pip install matplotlib 'multiprocess>=0.70.5,<1' matplotlib scipy 'numpy>=1.15
## Troubleshooting

This package is only maintained for Python 3 as of v1.0.2 and has only been tested for
Python 3.7.4 and 3.7.5. Check which version of Python you are running in your terminal
Python 3.7.5. Check which version of Python you are running in your terminal
with
```bash
$ python --version
Expand All @@ -167,9 +167,6 @@ ConIII has been tested on the following systems
* Ubuntu 18.04.1
* Mac OS X 10.15 (Catalina)

multiprocess module problems: `n_cpus` kwarg can be set to 0 or 1 when the algorithm class
instance is declared. This will disable the parallel computing functionality.

### Support

Please file an issue on the GitHub if you have any problems or feature requests. Provide a
Expand Down
2 changes: 1 addition & 1 deletion RELEASE_NOTES
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


v2.3.0 (Scheduled release 2020/04)
v2.3.0 (Released 2020/05)
----------------------------------------------------
- Sped up Metropolis sampling using Boost C++ extension. Up to 1000x speedup
achievable compared to Python version. This must be compiled separately and is
Expand Down
2 changes: 1 addition & 1 deletion coniii/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def setup_sampler(self,

self.sampleSize = sample_size

if sample_method=='metropolis' and type(self) is Ising:
if sample_method=='metropolis' and (type(self) is Ising or type(self) is Triplet):
self.sampleMethod = sample_method
self.sampler = Metropolis( self.n, self.multipliers, self.calc_e,
n_cpus=self.nCpus,
Expand Down
2 changes: 1 addition & 1 deletion coniii/samplers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1613,7 +1613,7 @@ def sample_metropolis(self, sample0, E0,
rng=None,
flip_site=None,
calc_e=None):
"""Metropolis sampling given an arbitrary sampling function.
"""Metropolis sampling given an arbitrary energy function.
Parameters
----------
Expand Down
2 changes: 1 addition & 1 deletion coniii/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1175,7 +1175,7 @@ def calc_observables(X, k=k):
Y = np.zeros((len(X), n*k+n*(n-1)//2), dtype=np.int8)

# average orientation (magnetization)
# note that fields for the third state are set to 0 by default
# note that fields for the third state are often set to 0
counter = 0
for i in range(k):
for j in range(n):
Expand Down
2 changes: 1 addition & 1 deletion coniii/version.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MIT License
#
# Copyright (c) 2019 Edward D. Lee, Bryan C. Daniels
# Copyright (c) 2020 Edward D. Lee, Bryan C. Daniels
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions docs/_build/html/coniii_rst/coniii.enumerate.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
<meta charset="utf-8" />
<title>coniii.enumerate module &#8212; ConIII 1.1.9 documentation</title>
Expand Down Expand Up @@ -250,7 +250,7 @@ <h3 id="searchlabel">Quick search</h3>
&copy;2018, Edward D. Lee, Bryan C. Daniels.

|
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.0.0</a>
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.0.3</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>

|
Expand Down
4 changes: 2 additions & 2 deletions docs/_build/html/coniii_rst/coniii.general_model_rmc.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
<meta charset="utf-8" />
<title>coniii.general_model_rmc module &#8212; ConIII 1.1.9 documentation</title>
Expand Down Expand Up @@ -94,7 +94,7 @@ <h3 id="searchlabel">Quick search</h3>
&copy;2018, Edward D. Lee, Bryan C. Daniels.

|
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.0.0</a>
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.0.3</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>

|
Expand Down
4 changes: 2 additions & 2 deletions docs/_build/html/coniii_rst/coniii.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
<meta charset="utf-8" />
<title>coniii package &#8212; ConIII 1.1.9 documentation</title>
Expand Down Expand Up @@ -140,7 +140,7 @@ <h3 id="searchlabel">Quick search</h3>
&copy;2018, Edward D. Lee, Bryan C. Daniels.

|
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.0.0</a>
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.0.3</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>

|
Expand Down
4 changes: 2 additions & 2 deletions docs/_build/html/coniii_rst/coniii.ising.automaton.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
<meta charset="utf-8" />
<title>coniii.ising.automaton module &#8212; ConIII 1.1.9 documentation</title>
Expand Down Expand Up @@ -142,7 +142,7 @@ <h3 id="searchlabel">Quick search</h3>
&copy;2018, Edward D. Lee, Bryan C. Daniels.

|
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.0.0</a>
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.0.3</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>

|
Expand Down
4 changes: 2 additions & 2 deletions docs/_build/html/coniii_rst/coniii.ising.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
<meta charset="utf-8" />
<title>coniii.ising package &#8212; ConIII 1.1.9 documentation</title>
Expand Down Expand Up @@ -114,7 +114,7 @@ <h3 id="searchlabel">Quick search</h3>
&copy;2018, Edward D. Lee, Bryan C. Daniels.

|
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.0.0</a>
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.0.3</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>

|
Expand Down
4 changes: 2 additions & 2 deletions docs/_build/html/coniii_rst/coniii.ising.test_automaton.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
<meta charset="utf-8" />
<title>coniii.ising.test_automaton module &#8212; ConIII 1.1.9 documentation</title>
Expand Down Expand Up @@ -104,7 +104,7 @@ <h3 id="searchlabel">Quick search</h3>
&copy;2018, Edward D. Lee, Bryan C. Daniels.

|
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.0.0</a>
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.0.3</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>

|
Expand Down
4 changes: 2 additions & 2 deletions docs/_build/html/coniii_rst/coniii.mc_hist.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
<meta charset="utf-8" />
<title>coniii.mc_hist module &#8212; ConIII 1.1.9 documentation</title>
Expand Down Expand Up @@ -94,7 +94,7 @@ <h3 id="searchlabel">Quick search</h3>
&copy;2018, Edward D. Lee, Bryan C. Daniels.

|
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.0.0</a>
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.0.3</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>

|
Expand Down
4 changes: 2 additions & 2 deletions docs/_build/html/coniii_rst/coniii.mean_field_ising.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
<meta charset="utf-8" />
<title>coniii.mean_field_ising module &#8212; ConIII 1.1.9 documentation</title>
Expand Down Expand Up @@ -329,7 +329,7 @@ <h3 id="searchlabel">Quick search</h3>
&copy;2018, Edward D. Lee, Bryan C. Daniels.

|
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.0.0</a>
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.0.3</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>

|
Expand Down
4 changes: 2 additions & 2 deletions docs/_build/html/coniii_rst/coniii.pseudo_inverse_ising.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
<meta charset="utf-8" />
<title>coniii.pseudo_inverse_ising module &#8212; ConIII 1.1.9 documentation</title>
Expand Down Expand Up @@ -158,7 +158,7 @@ <h3 id="searchlabel">Quick search</h3>
&copy;2018, Edward D. Lee, Bryan C. Daniels.

|
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.0.0</a>
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.0.3</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>

|
Expand Down
6 changes: 3 additions & 3 deletions docs/_build/html/coniii_rst/coniii.samplers.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
<meta charset="utf-8" />
<title>coniii.samplers module &#8212; ConIII 1.1.9 documentation</title>
Expand Down Expand Up @@ -85,7 +85,7 @@

<dl class="py method">
<dt id="coniii.samplers.Heisenberg3DSampler.sample_energy_min">
<code class="sig-name descname">sample_energy_min</code><span class="sig-paren">(</span><em class="sig-param">nFixed=0</em>, <em class="sig-param">rng=RandomState(MT19937) at 0x7FDE1722E5A0</em>, <em class="sig-param">initialState=None</em>, <em class="sig-param">method='powell'</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#coniii.samplers.Heisenberg3DSampler.sample_energy_min" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">sample_energy_min</code><span class="sig-paren">(</span><em class="sig-param">nFixed=0</em>, <em class="sig-param">rng=RandomState(MT19937) at 0x7F4DCC0E07C0</em>, <em class="sig-param">initialState=None</em>, <em class="sig-param">method='powell'</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#coniii.samplers.Heisenberg3DSampler.sample_energy_min" title="Permalink to this definition"></a></dt>
<dd><p>Find local energy minimum given state in angular form. Angular representation
makes it easy to be explicit about constraints on the vectors.</p>
<dl class="simple">
Expand Down Expand Up @@ -791,7 +791,7 @@ <h3 id="searchlabel">Quick search</h3>
&copy;2018, Edward D. Lee, Bryan C. Daniels.

|
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.0.0</a>
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.0.3</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>

|
Expand Down
4 changes: 2 additions & 2 deletions docs/_build/html/coniii_rst/coniii.solvers.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
<meta charset="utf-8" />
<title>coniii.solvers module &#8212; ConIII 1.1.9 documentation</title>
Expand Down Expand Up @@ -781,7 +781,7 @@ <h3 id="searchlabel">Quick search</h3>
&copy;2018, Edward D. Lee, Bryan C. Daniels.

|
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.0.0</a>
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.0.3</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>

|
Expand Down
4 changes: 2 additions & 2 deletions docs/_build/html/coniii_rst/coniii.test_samplers.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
<meta charset="utf-8" />
<title>coniii.test_samplers module &#8212; ConIII 1.1.9 documentation</title>
Expand Down Expand Up @@ -119,7 +119,7 @@ <h3 id="searchlabel">Quick search</h3>
&copy;2018, Edward D. Lee, Bryan C. Daniels.

|
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.0.0</a>
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.0.3</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>

|
Expand Down
4 changes: 2 additions & 2 deletions docs/_build/html/coniii_rst/coniii.test_solvers.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
<meta charset="utf-8" />
<title>coniii.test_solvers module &#8212; ConIII 1.1.9 documentation</title>
Expand Down Expand Up @@ -121,7 +121,7 @@ <h3 id="searchlabel">Quick search</h3>
&copy;2018, Edward D. Lee, Bryan C. Daniels.

|
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.0.0</a>
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.0.3</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>

|
Expand Down
4 changes: 2 additions & 2 deletions docs/_build/html/coniii_rst/coniii.test_utils.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
<meta charset="utf-8" />
<title>coniii.test_utils module &#8212; ConIII 1.1.9 documentation</title>
Expand Down Expand Up @@ -145,7 +145,7 @@ <h3 id="searchlabel">Quick search</h3>
&copy;2018, Edward D. Lee, Bryan C. Daniels.

|
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.0.0</a>
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.0.3</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>

|
Expand Down
Loading

0 comments on commit 0d48825

Please sign in to comment.