Skip to content

Commit 0c04205

Browse files
committed
Modified count_bonds.py to exclude bond counts with 0 bonds
1 parent 5d7ffc0 commit 0c04205

File tree

9 files changed

+8474
-695
lines changed

9 files changed

+8474
-695
lines changed

worm_algorithm/block_configs.ipynb

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"ExecuteTime": {
1515
"end_time": "2018-02-14T07:02:03.470104Z",
1616
"start_time": "2018-02-14T07:02:03.402771Z"
17-
}
17+
},
18+
"collapsed": true
1819
},
1920
"outputs": [],
2021
"source": [
@@ -57,7 +58,8 @@
5758
"ExecuteTime": {
5859
"end_time": "2018-02-14T07:02:20.821016Z",
5960
"start_time": "2018-02-14T07:02:20.779909Z"
60-
}
61+
},
62+
"collapsed": true
6163
},
6264
"outputs": [],
6365
"source": [
@@ -82,7 +84,8 @@
8284
"ExecuteTime": {
8385
"end_time": "2018-02-14T07:06:56.468428Z",
8486
"start_time": "2018-02-14T07:03:06.769141Z"
85-
}
87+
},
88+
"collapsed": true
8689
},
8790
"outputs": [
8891
{
@@ -314,7 +317,8 @@
314317
"ExecuteTime": {
315318
"end_time": "2018-02-14T07:15:38.264660Z",
316319
"start_time": "2018-02-14T07:06:56.471148Z"
317-
}
320+
},
321+
"collapsed": true
318322
},
319323
"outputs": [
320324
{
@@ -540,7 +544,8 @@
540544
"ExecuteTime": {
541545
"end_time": "2018-02-11T05:51:16.514653Z",
542546
"start_time": "2018-02-11T04:53:37.782988Z"
543-
}
547+
},
548+
"collapsed": true
544549
},
545550
"outputs": [
546551
{
@@ -755,7 +760,7 @@
755760
"end_time": "2018-02-14T08:53:44.026829Z",
756761
"start_time": "2018-02-14T07:18:52.813715Z"
757762
},
758-
"scrolled": true
763+
"collapsed": true
759764
},
760765
"outputs": [
761766
{
@@ -797,7 +802,8 @@
797802
"ExecuteTime": {
798803
"end_time": "2018-02-11T04:16:04.973886Z",
799804
"start_time": "2018-02-11T04:16:04.207233Z"
800-
}
805+
},
806+
"collapsed": true
801807
},
802808
"outputs": [],
803809
"source": [
@@ -811,7 +817,8 @@
811817
"ExecuteTime": {
812818
"end_time": "2018-02-11T04:16:30.116180Z",
813819
"start_time": "2018-02-11T04:16:30.076712Z"
814-
}
820+
},
821+
"collapsed": true
815822
},
816823
"outputs": [
817824
{
@@ -837,7 +844,8 @@
837844
"ExecuteTime": {
838845
"end_time": "2018-02-11T04:18:18.992227Z",
839846
"start_time": "2018-02-11T04:18:18.961658Z"
840-
}
847+
},
848+
"collapsed": true
841849
},
842850
"outputs": [],
843851
"source": [
@@ -851,7 +859,8 @@
851859
"ExecuteTime": {
852860
"end_time": "2018-02-11T04:18:22.609146Z",
853861
"start_time": "2018-02-11T04:18:22.567577Z"
854-
}
862+
},
863+
"collapsed": true
855864
},
856865
"outputs": [
857866
{
@@ -877,7 +886,7 @@
877886
"end_time": "2018-02-11T04:19:15.041598Z",
878887
"start_time": "2018-02-11T04:19:14.914851Z"
879888
},
880-
"scrolled": false
889+
"collapsed": true
881890
},
882891
"outputs": [
883892
{
@@ -1696,7 +1705,7 @@
16961705
"end_time": "2018-02-11T04:18:42.076673Z",
16971706
"start_time": "2018-02-11T04:18:41.947982Z"
16981707
},
1699-
"scrolled": true
1708+
"collapsed": true
17001709
},
17011710
"outputs": [
17021711
{
@@ -2514,7 +2523,8 @@
25142523
"ExecuteTime": {
25152524
"end_time": "2018-02-11T04:14:50.553525Z",
25162525
"start_time": "2018-02-11T04:14:42.966791Z"
2517-
}
2526+
},
2527+
"collapsed": true
25182528
},
25192529
"outputs": [
25202530
{
@@ -2547,7 +2557,9 @@
25472557
{
25482558
"cell_type": "code",
25492559
"execution_count": null,
2550-
"metadata": {},
2560+
"metadata": {
2561+
"collapsed": true
2562+
},
25512563
"outputs": [],
25522564
"source": []
25532565
}
@@ -2569,7 +2581,7 @@
25692581
"name": "python",
25702582
"nbconvert_exporter": "python",
25712583
"pygments_lexer": "ipython3",
2572-
"version": "3.6.4"
2584+
"version": "3.6.5"
25732585
},
25742586
"latex_envs": {
25752587
"LaTeX_envs_menu_present": true,

worm_algorithm/bonds.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ def __init__(self, L, run=False, num_steps=1E7, verbose=True,
5757
self._x_bonds = {}
5858
self._y_bonds = {}
5959
self._config_data = self.set_config_data()
60-
self._blocked_config_data = self.block_configs(block_val)
6160
if write:
6261
self.write_config_data()
6362
if write_blocked:
63+
self._blocked_config_data = self.block_configs(block_val)
6464
self.write_blocked_config_data()
6565

6666
def _get_raw_bonds(self):

worm_algorithm/count_bonds.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class CountBonds(object):
2424
Directory containing configuration data to be analyzed.
2525
_save_dir : (str)
2626
Directory where resulting bond_statistics data is to be written to.
27-
_write : bool
27+
_save : bool
2828
Whether or not to save the bond_statistics data.
2929
_verbose : bool
3030
Whether or not to display information as the analysis is being
@@ -111,6 +111,7 @@ def _count_bonds(self, data):
111111
np.sum([config[i] for i in bond_idxs]) for config in
112112
data.reshape(-1, w, w)
113113
])
114+
bc_arr = bc_arr[np.where(bc_arr != 0)]
114115
bc2_arr = bc_arr ** 2
115116
Nb_avg = np.mean(bc_arr)
116117
Nb2_avg = np.mean(bc2_arr)

0 commit comments

Comments
 (0)