-
Notifications
You must be signed in to change notification settings - Fork 823
WIP: Master merge #3299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Master merge #3299
Changes from all commits
ada0f2f
b5e5906
13a97e4
cc64b45
a28739a
b55e64f
2d474e9
e464e9a
6a274d7
dfb09d6
723cd89
fbc1688
4734057
12a795e
85c0c56
f846427
ae72fe9
5b55e0e
3fa9bf7
ea708b0
2b327cd
b07983c
9189429
f7a6f47
e8a1648
bc5be1f
39b0e4c
bd83af7
bd3ff77
d9e58f2
108ffe0
7c119ab
03ae3bc
b7f36bd
8622a0e
de6f119
a1d9f75
9fd8913
7d8d0e6
d571723
5c19974
074a4e1
4f46946
cdb96ff
7c468a4
e5e4f5e
ee47592
1a8759c
169db04
85ebe43
7d03843
4365f3b
efe48c4
4db8130
bf16435
a2a9a5c
dbd39c2
8af09d7
7313cf1
dbaf957
dd4490a
bbafbbe
28f043f
656e724
dd0bbe4
1e107ed
e8fbd52
fa6bc1f
720ab7a
de8813e
721c800
5608bb8
7c1c426
89cf0a3
9100720
b672b59
c6e27a3
82ff196
4ed8f41
b27a59f
27dae7c
4173028
f6cf595
d91e5e8
52679c7
1327583
2ebb052
992d0e3
ecbbc4e
9c496f6
3619b53
4303288
efb9137
1116b7e
c4fa754
5a259b7
e12bd3f
3640cd8
088a666
73cd1e6
49cb0a8
2ef90f2
e8403c7
0b6b372
b37f518
9da4442
0e3c108
63444aa
0030b38
3b941da
c07b5c8
082b087
7a92b3c
74f229c
383d15e
86eb383
0f9a6e5
7f83f4a
a64eed9
454bd4d
60ea0bb
c88698d
6a99f57
09bdc9a
c3c4240
fe6cb34
8c1fbd6
ebd9c02
6e2d8e7
c1bef0f
c69be8f
f64e5a5
658a73d
6eb715a
bc95e31
d9dcdcd
d3b38cd
232b4dc
7ed893d
1eede18
03c6317
e4659fb
2c9be4e
5c61de4
eb73468
9a03aec
04e8af4
c6f1a5a
1522653
0880dc1
b5ab73d
de8933a
361ca7e
76c9dc0
c70504d
740cae2
e4cb6ba
1e456e8
53b4bae
f570784
aa58252
6e1815e
a4f5438
d25edd0
03a9a0b
9c6e751
3938f92
947f497
01ee954
c3b776b
db2a6d8
22122b4
80467a7
b027575
0f73093
4dc31dc
66acbdf
1cc1939
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -768,7 +768,8 @@ def count_by_time(self): | |
| indices /= self.step | ||
|
|
||
| counts = np.zeros_like(self.frames) | ||
| counts[indices.astype(int)] = tmp_counts | ||
| counts[indices.astype(np.intp)] = tmp_counts | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is more correct right? i.e. np.intp is the correct type for indexing?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah I think this is the 32/64 bit compliant way of saying the integer that addresses anything (i.e.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So the difference here was just between what Tyler and I wrote for the numpy 1.20 deprecation stuff, as long as it works and isn't significantly difference in terms of performance let's just go with it. |
||
|
|
||
| return counts | ||
|
|
||
| def count_by_type(self): | ||
|
|
@@ -786,8 +787,8 @@ def count_by_type(self): | |
| acceptor atoms in a hydrogen bond. | ||
| """ | ||
|
|
||
| d = self.u.atoms[self.results.hbonds[:, 1].astype(int)] | ||
| a = self.u.atoms[self.results.hbonds[:, 3].astype(int)] | ||
| d = self.u.atoms[self.hbonds[:, 1].astype(np.intp)] | ||
| a = self.u.atoms[self.hbonds[:, 3].astype(np.intp)] | ||
|
|
||
| tmp_hbonds = np.array([d.resnames, d.types, a.resnames, a.types], | ||
| dtype=str).T | ||
|
|
@@ -815,9 +816,9 @@ def count_by_ids(self): | |
| in a hydrogen bond. | ||
| """ | ||
|
|
||
| d = self.u.atoms[self.results.hbonds[:, 1].astype(int)] | ||
| h = self.u.atoms[self.results.hbonds[:, 2].astype(int)] | ||
| a = self.u.atoms[self.results.hbonds[:, 3].astype(int)] | ||
| d = self.u.atoms[self.hbonds[:, 1].astype(np.intp)] | ||
| h = self.u.atoms[self.hbonds[:, 2].astype(np.intp)] | ||
| a = self.u.atoms[self.hbonds[:, 3].astype(np.intp)] | ||
|
|
||
| tmp_hbonds = np.array([d.ids, h.ids, a.ids]).T | ||
| hbond_ids, ids_counts = np.unique(tmp_hbonds, axis=0, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -823,6 +823,18 @@ class NCDFWriter(base.WriterBase): | |
| .. _`Issue #506`: | ||
| https://github.com/MDAnalysis/mdanalysis/issues/506#issuecomment-225081416 | ||
|
|
||
| Raises | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These changes are good for now, we can change it once #3294 is merged (probably after the beta at this rate). |
||
| ------ | ||
| FutureWarning | ||
| When writing. The :class:`NCDFWriter` currently does not write any | ||
| `scale_factor` values for the data variables. Whilst not in breach | ||
| of the AMBER NetCDF standard, this behaviour differs from that of | ||
| most AMBER writers, especially for velocities which usually have a | ||
| `scale_factor` of 20.455. In MDAnalysis 2.0, the :class:`NCDFWriter` | ||
| will enforce `scale_factor` writing to either match user inputs (either | ||
| manually defined or via the :class:`NCDFReader`) or those as written by | ||
| AmberTools's :program:`sander` under default operation. | ||
|
|
||
| See Also | ||
| -------- | ||
| :class:`NCDFReader` | ||
|
|
@@ -882,6 +894,13 @@ def __init__(self, | |
| self.has_forces = kwargs.get('forces', False) | ||
| self.curr_frame = 0 | ||
|
|
||
| # warn users of upcoming changes | ||
| wmsg = ("In MDAnalysis v2.0, `scale_factor` writing will change (" | ||
| "currently these are not written), to better match the way " | ||
| "they are written by AMBER programs. See NCDFWriter docstring " | ||
| "for more details.") | ||
| warnings.warn(wmsg, FutureWarning) | ||
|
|
||
| def _init_netcdf(self, periodic=True): | ||
| """Initialize netcdf AMBER 1.0 trajectory. | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.