Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
b6d5ba9
update evaluatir modules
jeff231li Oct 31, 2022
24833e4
update read_yaml module for taproom
jeff231li Oct 31, 2022
0d89c98
Merge branch 'master' into update_evaluator_modules
jeff231li Nov 1, 2022
d8d85a3
refactor code
jeff231li Nov 2, 2022
cd9b952
add unit tests
jeff231li Nov 2, 2022
962693d
add more test
jeff231li Nov 2, 2022
c85beca
Merge branch 'master' into update_evaluator_modules
jeff231li Nov 3, 2022
02b9d35
add warnings about pint unit
jeff231li Nov 3, 2022
893526f
Merge branch 'master' into update_evaluator_modules
jeff231li Apr 27, 2023
630e6f7
Merge branch 'master' into update_evaluator_modules
jeff231li Apr 28, 2023
43a1f6b
lint
jeff231li Apr 28, 2023
53cffad
fix import statements
jeff231li Apr 28, 2023
6097b2d
update import package name
jeff231li Apr 28, 2023
6ec67f9
Merge branch 'master' into update_evaluator_modules
jeff231li Apr 30, 2023
9161510
add more tests
jeff231li Apr 30, 2023
81c9d36
add more test and change import namespace
jeff231li May 1, 2023
3bfb5e7
update unit import
jeff231li May 1, 2023
1b0e536
update align modules
jeff231li May 26, 2023
2eedf89
fix argument order
jeff231li May 26, 2023
0d4b3eb
fix bug in align
jeff231li May 26, 2023
1f3d49f
lint
jeff231li May 27, 2023
3e900b4
Merge branch 'master' into update_evaluator_modules
jeff231li Jun 4, 2023
6db6b4b
fix import namespace
jeff231li Jun 4, 2023
67d937e
remove tmp folder
jeff231li Jun 4, 2023
f28dd36
refactor taproom stuff
jeff231li Jun 4, 2023
110987b
update test_analysis
jeff231li Jun 4, 2023
727eb4f
Merge branch 'master' into update_evaluator_modules
jeff231li Jun 4, 2023
fcdff49
add module to build APR from Taproom
Jul 12, 2023
fbdddc1
lint
jeff231li Jul 12, 2023
571d80f
include interchange in devtools
jeff231li Jul 12, 2023
dc78db2
update taproom code
jeff231li Jul 12, 2023
9bd5ac0
update taproom modules
jeff231li Jul 31, 2023
b44990f
update docstring
jeff231li Jul 31, 2023
976bd80
add stuff
jeff231li Jul 31, 2023
cca2037
fix system preparation
jeff231li Jul 31, 2023
bf29ead
uncomment cleanup
jeff231li Jul 31, 2023
378fd85
fix bug
jeff231li Aug 1, 2023
b72b25c
allow getting taproom with different Python versions
jeff231li Aug 28, 2023
7d909a7
Merge branch 'master' into update_evaluator_modules
jeff231li Aug 28, 2023
8adc38a
add tutorial for generating taproom systems
jeff231li Aug 28, 2023
de00e79
update tutorial
jeff231li Aug 29, 2023
65e4735
fix import bug
jeff231li Aug 30, 2023
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
1 change: 1 addition & 0 deletions devtools/conda-envs/test_env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ dependencies:
- pyyaml
- plumed
- intermol
- openff-interchange >=0.3.7
- openff-units >=0.2.0
- openff-utilities

Expand Down
891 changes: 891 additions & 0 deletions docs/tutorials/08-generating-taproom-systems.ipynb

Large diffs are not rendered by default.

237 changes: 121 additions & 116 deletions paprika/analysis/analysis.py

Large diffs are not rendered by default.

227 changes: 123 additions & 104 deletions paprika/analysis/bootstrap.py

Large diffs are not rendered by default.

30 changes: 18 additions & 12 deletions paprika/analysis/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import numpy as np
import numpy


def get_factors(n):
Expand All @@ -17,7 +17,7 @@ def get_factors(n):

"""
factors = []
sqrt_n = int(round(np.sqrt(n) + 0.5))
sqrt_n = int(round(numpy.sqrt(n) + 0.5))
i = 1
while i <= sqrt_n:
if n % i == 0:
Expand All @@ -26,6 +26,7 @@ def get_factors(n):
if j != i:
factors.append(int(j))
i += 1

return sorted(factors, key=int)


Expand All @@ -45,19 +46,24 @@ def get_nearest_max(n):

"""
max_factors = 0

if n % 2 == 0:
beg = n - 100
end = n
else:
beg = n - 101
end = n - 1

if beg < 0:
beg = 0

most_factors = 0
for i in range(beg, end + 2, 2):
num_factors = len(get_factors(i))
if num_factors >= max_factors:
max_factors = num_factors
most_factors = i

return most_factors


Expand All @@ -72,12 +78,12 @@ def get_block_sem(data_array):

Parameters
----------
data_array: :class:`np.array`
data_array: :class:`numpy.array`
Array containing data values.

Returns
-------
np.max(sems): float
numpy.max(sems): float
The maximum SEM obtained from te blocking curve.

"""
Expand All @@ -86,11 +92,11 @@ def get_block_sem(data_array):
block_sizes = get_factors(len(data_array))

# An array to store means for each block ... make it bigger than we need.
block_means = np.zeros([block_sizes[-1]], np.float64)
block_means = numpy.zeros([block_sizes[-1]], numpy.float64)

# Store the SEM for each block size, except the last two size for which
# there will only be two or one blocks total and thus very noisy.
sems = np.zeros([len(block_sizes) - 2], np.float64)
sems = numpy.zeros([len(block_sizes) - 2], numpy.float64)

# Check each block size except the last two.
for size_idx in range(len(block_sizes) - 2):
Expand All @@ -102,15 +108,15 @@ def get_block_sem(data_array):
data_beg_idx = blk_idx * block_sizes[size_idx]
data_end_idx = (blk_idx + 1) * block_sizes[size_idx]
# Compute the mean of this block and store in array
block_means[blk_idx] = np.mean(data_array[data_beg_idx:data_end_idx])
block_means[blk_idx] = numpy.mean(data_array[data_beg_idx:data_end_idx])
# Compute the standard deviation across all blocks, devide by
# num_blocks-1 for SEM
sems[size_idx] = np.std(block_means[0:num_blocks], ddof=0) / np.sqrt(
sems[size_idx] = numpy.std(block_means[0:num_blocks], ddof=0) / numpy.sqrt(
num_blocks - 1
)
# Hmm or should ddof=1? I think 0, see Flyvbjerg -----^

return np.max(sems)
return numpy.max(sems)


def get_subsampled_indices(N, g, conservative=False):
Expand Down Expand Up @@ -138,16 +144,16 @@ def get_subsampled_indices(N, g, conservative=False):

# if conservative, assume integer g and round up
if conservative:
g = np.ceil(g)
g = numpy.ceil(g)

# initialize
indices = [0]
g_idx = 1.0
int_step = int(np.round(g_idx * g))
int_step = int(numpy.round(g_idx * g))

while int_step < N:
indices.append(int_step)
g_idx += 1.0
int_step = int(np.round(g_idx * g))
int_step = int(numpy.round(g_idx * g))

return indices
2 changes: 2 additions & 0 deletions paprika/build/system/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
from paprika.build.system.tleap import TLeap
from paprika.build.system.utils import ConversionToolkit, PBCBox
from paprika.build.system.taproom import BuildTaproomAPR

__all__ = [
"ConversionToolkit",
"PBCBox",
"TLeap",
"BuildTaproomAPR",
]
Loading