Skip to content

Commit b64b497

Browse files
authored
Merge pull request #2 from DeepanshS/latest
Code format and documentation cleanup.
2 parents 9a7b1b8 + 8a0bf3d commit b64b497

35 files changed

+708
-471
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99

1010
The `mrinversion` python package is based on the statistical learning technique for
1111
determining the distribution of the magnetic resonance (NMR) tensor parameters
12-
from the two-dimensional NMR spectra correlating the isotropic to anisotropic
13-
resonances.
12+
from two-dimensional NMR spectra correlating the isotropic to anisotropic
13+
frequencies.
1414
The library utilizes the [mrsimulator](https://mrsimulator.readthedocs.io/en/latest/)
15-
package for generating solid-state NMR lineshapes and
15+
package for generating solid-state NMR spectra and
1616
[scikit-learn](https://scikit-learn.org/latest/) package for statistical learning.
1717

1818
---
@@ -23,17 +23,17 @@ The `mrinversion` package includes the **inversion of a two-dimensional
2323
solid-state NMR spectrum of dilute spin-systems to a three-dimensional distribution of
2424
tensor parameters**. At present, we support the inversion of
2525

26-
- **Magic angle flipping (MAF)** spectra correlating the isotropic chemical shift
27-
resonances to pure anisotropic resonances into a three-dimensional distribution of
28-
nuclear shielding tensor parameters---isotropic chemical shift, shielding
29-
anisotropy and asymmetry parameters---defined using the Haeberlen convention.
30-
3126
- **Magic angle turning (MAT), Phase adjusted spinning sidebands (PASS)**, and similar
3227
spectra correlating the isotropic chemical shift resonances to pure anisotropic
3328
spinning sideband resonances into a three-dimensional distribution of
3429
nuclear shielding tensor parameters---isotropic chemical shift, shielding
3530
anisotropy and asymmetry parameters---defined using the Haeberlen convention.
3631

32+
- **Magic angle flipping (MAF)** spectra correlating the isotropic chemical shift
33+
resonances to pure anisotropic resonances into a three-dimensional distribution of
34+
nuclear shielding tensor parameters---isotropic chemical shift, shielding
35+
anisotropy and asymmetry parameters---defined using the Haeberlen convention.
36+
3737
For more information, refer to the
3838
[documentation](https://mrinversion.readthedocs.io/en/latest/).
3939

docs/_static/style.css

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ h1 {
1515
}
1616

1717
h2 {
18-
font-size: 1.8em;
18+
font-size: 1.6em;
1919
font-weight: 400;
2020
color: #70360f;
2121
padding-bottom: 1.2em;
@@ -25,20 +25,20 @@ h2 {
2525
}
2626

2727
h3 {
28-
font-size: 1.4em;
28+
font-size: 1.3em;
2929
text-decoration: underline;
30-
color: rgb(63, 63, 63);
30+
color: #3f3f3f;
3131
}
3232

3333
h4 {
3434
margin-top: 1.4em;
3535
font-size: 1.2em;
36-
color: rgb(128, 74, 74);
36+
color: #663d3d;
3737
}
3838

3939
h5 {
4040
font-size: 1.1em;
41-
color: rgb(53, 53, 53);
41+
color: #353535;
4242
}
4343

4444
h6 {
@@ -141,7 +141,12 @@ table caption:hover {
141141
.docutils.container {
142142
width: auto;
143143
}
144-
144+
.highlighttable .code {
145+
max-width: 100%;
146+
}
147+
.highlighttable .linenos {
148+
width: auto;
149+
}
145150
.ui.segment[class*="bottom attached"] {
146151
width: 100%;
147152
padding: 2em;
@@ -217,7 +222,7 @@ table caption:hover {
217222
}
218223

219224
.sidebar .logo img {
220-
filter: invert(1) brightness(1.25);
225+
filter: invert(1) brightness(1.75);
221226
}
222227

223228
/* searchbar */
@@ -239,9 +244,30 @@ table caption:hover {
239244
padding-left: 24px;
240245
padding-right: 24px;
241246
}
242-
247+
.sidebar.hidden-xs > h3 {
248+
display: none;
249+
}
250+
.toctree-wrapper.compound > p.caption {
251+
display: none;
252+
}
253+
.sidebar.hidden-xs > p.caption {
254+
padding-left: 24px;
255+
padding-top: 3px;
256+
padding-bottom: 3px;
257+
font-size: 1.1em;
258+
font-weight: 500;
259+
background-color: #5a5a5a;
260+
color: #ffffff;
261+
margin: 10px 0 0 0;
262+
}
243263
.sidebar.hidden-xs > ul {
244264
padding: 0;
265+
}
266+
.sidebar.hidden-xs > ul:first-child {
267+
padding-top: 1em;
268+
margin-top: 1em;
269+
}
270+
.sidebar.hidden-xs > ul:last-child {
245271
padding-bottom: 1em;
246272
margin-bottom: 1em;
247273
}

docs/api/shielding_kernel.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ Pure anisotropic Nuclear Shielding Kernel
88
Generalized Class
99
-----------------
1010

11-
.. currentmodule:: mrinversion.kernel
11+
.. currentmodule:: mrinversion.kernel.nmr
1212

13-
.. autoclass:: NuclearShieldingLineshape
13+
.. autoclass:: ShieldingPALineshape
1414
:show-inheritance:
1515

1616
.. automethod:: kernel

docs/api/utils.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ Utils
66
.. currentmodule:: mrinversion.kernel.utils
77

88
.. autofunction:: x_y_to_zeta_eta
9-
109
.. autofunction:: zeta_eta_to_x_y
1110

1211

1312
.. currentmodule:: mrinversion.utils
1413

14+
.. autofunction:: get_polar_grids
1515
.. autofunction:: plot_3d

docs/before_getting_started.rst

Lines changed: 54 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -12,40 +12,64 @@
1212
Before getting started
1313
======================
1414

15-
Prepping the dataset
16-
--------------------
15+
Prepping the 2D dataset for inversion
16+
-------------------------------------
1717

18-
The following are some recommendations to help prep your dataset before subjecting to
19-
linear inversion.
18+
The following is a list of some requirements and recommendations to help prepare
19+
the 2D dataset for inversion.
2020

21-
Magic angle flipping datasets
22-
'''''''''''''''''''''''''''''
21+
Common recommendations/requirements
22+
'''''''''''''''''''''''''''''''''''
2323

2424
.. list-table::
25-
:widths: 1 25 74
25+
:widths: 2 98
2626

2727
* - |uncheck|
28-
- **Did you shear the dataset?**
29-
- The inversion method assumes that the MAF dataset is sheared, such that one of
30-
the dimensions is a purely anisotropic frequency dimension.
28+
- **Dataset shear**
29+
30+
The inversion method assumes that the 2D dataset is sheared, such that one of the
31+
dimensions corresponds to a pure anisotropic spectrum. The anisotropic
32+
cross-sections are centered at 0 Hz.
3133

3234
**Required**: Apply a shear transformation before proceeding.
3335

36+
* - |uncheck|
37+
- **Calculate the noise standard deviation**
38+
39+
Use the noise region of your spectrum to calculate the standard deviation of the
40+
noise. You will require this value when implementing cross-validation.
41+
42+
43+
Spinning Sideband correlation dataset specific recommendations
44+
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
45+
46+
.. list-table::
47+
:widths: 2 98
3448

3549
* - |uncheck|
36-
- **Did you zero-fill the time-domain dataset corresponding to the anisotropic
37-
dimension?**
38-
- Zero filling the time domain dataset is purely cosmetic. It makes the spectrum
39-
look visually appealing, but adds no information, that is, a zero-filled dataset
40-
contains the same information as a non-zero filled dataset. In terms of
41-
computation, however, a zero-filled spectrum will take longer to solve.
50+
- **Data-repeat operation**
51+
52+
A data-repeat operation on the time-domain signal corresponding to the sideband
53+
dimension makes the spinning sidebands look like a stick spectrum after a
54+
Fourier transformation, a visual, which most NMR spectroscopists are familiar
55+
from the 1D magic-angle spinning spectrum. Like a zero-fill operation, a spinning
56+
sideband data-repeat operation is purely cosmetic and adds no information.
57+
In terms of computation, however, a data-repeated spinning-sideband spectrum will
58+
take longer to solve.
59+
60+
**Strongly recommended**: Avoid data-repeat operation.
61+
4262

43-
**Recommendation**: Try to keep the total number of points along the anisotropic
44-
dimension in the range of 120 - 150 points.
63+
Magic angle flipping dataset specific recommendations
64+
'''''''''''''''''''''''''''''''''''''''''''''''''''''
65+
66+
.. list-table::
67+
:widths: 2 98
4568

4669
* - |uncheck|
47-
- **Did you correct for the isotropic offset along the anisotropic dimension?**
48-
- Ordinarily, after shear, a MAF spectrum is a 2D isotropic `v.s` pure anisotropic
70+
- **Isotropic shift correction along the anisotropic dimension**
71+
72+
Ordinarily, after shear, a MAF spectrum is a 2D isotropic `vs.` pure anisotropic
4973
frequency correlation spectrum. In certain conditions, this is not true. In a MAF
5074
experiment, the sample holder (rotor) physically swaps between two angles
5175
(:math:`90^\circ \leftrightarrow 54.735^\circ`). It is possible to have a
@@ -57,30 +81,17 @@ Magic angle flipping datasets
5781
anisotropic dimension by adding an appropriate coordinates-offset.
5882

5983
* - |uncheck|
60-
- **Are there sinc wiggles in your spectrum?**
61-
- Kernel correction for spectrum with sinc wiggle artifacts is coming soon.
84+
- **Zero-fill operation**
6285

63-
Spinning Sideband correlation datasets
64-
''''''''''''''''''''''''''''''''''''''
65-
66-
.. list-table::
67-
:widths: 1 25 74
68-
69-
* - |uncheck|
70-
- **Did you shear the dataset?**
71-
- The inversion method assumes that the spinning sideband dataset is sheared, such that
72-
one of the dimensions is a pure anisotropic spinning sidebands dimension.
86+
Zero filling the time domain dataset is purely cosmetic. It makes the spectrum
87+
look visually appealing, but adds no information, that is, a zero-filled dataset
88+
contains the same information as a non-zero filled dataset. In terms of
89+
computation, however, a zero-filled spectrum will take longer to solve.
7390

74-
**Required**: Apply a shear transformation before proceeding.
91+
**Recommendation**: If zero-filled, try to keep the total number of points along
92+
the anisotropic dimension in the range of 120 - 150 points.
7593

76-
* - |uncheck|
77-
- **Did you data-repeat the time-domain signal corresponding to the sideband dimension?**
78-
- A data-repeat operation on the time-domain signal corresponding to the sideband
79-
dimension makes the spinning sidebands look like a stick spectrum after a
80-
Fourier transformation, a visual, which most NMR spectroscopists are familiar
81-
from the 1D magic-angle spinning spectrum. Like a zero-fill operation, a spinning
82-
sideband data-repeat operation is also purely cosmetic and adds no information.
83-
In terms of computation, however, a data-repeated spinning-sideband spectrum will
84-
take longer to solve.
94+
* -
95+
- **Sinc wiggles artifacts**
8596

86-
**Strongly recommended**: Avoid data-repeat operation.
97+
Kernel correction for spectrum with sinc wiggle artifacts is coming soon.

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
"gallery_dirs": "auto_examples", # path to where to save gallery generated output
101101
"within_subsection_order": FileNameSortKey,
102102
"subsection_order": ExplicitOrder(
103-
["../examples/synthetic", "../examples/MAF", "../examples/sideband"]
103+
["../examples/synthetic", "../examples/sideband", "../examples/MAF"]
104104
),
105105
"reference_url": {
106106
# The module you locally document uses None
@@ -115,7 +115,7 @@
115115
"astropy": ("https://docs.astropy.org/en/stable/", None),
116116
}
117117

118-
copybutton_prompt_text = ">>> |\\\\$ |\\[\\d*\\]: |\\.\\.\\.: |[.][.][.] "
118+
copybutton_prompt_text = ">>> |\\$ |\\[\\d*\\]: |\\.\\.\\.: |[.][.][.] "
119119
copybutton_prompt_is_regexp = True
120120

121121
# ---------------------------------------------------------------------------- #

docs/credits/acknowledgment.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Acknowledgment
2+
==============
3+
4+
The development of the mrinversion library is supported in part by the US National
5+
Science Foundation under Grant No. DIBBS OAC 1640899 and Grant No. CHE 1807922.

docs/credits/license.rst

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
License
2+
=======
3+
4+
Mrinversion License
5+
-------------------
6+
7+
Mrinversion is licensed under BSD 3-Clause License.
8+
9+
Copyright (c) 2020, Deepansh J. Srivastava,
10+
11+
All rights reserved.
12+
13+
Redistribution and use in source and binary forms, with or without
14+
modification, are permitted provided that the following conditions are met:
15+
16+
* Redistributions of source code must retain the above copyright notice, this
17+
list of conditions and the following disclaimer.
18+
19+
* Redistributions in binary form must reproduce the above copyright notice,
20+
this list of conditions and the following disclaimer in the documentation
21+
and/or other materials provided with the distribution.
22+
23+
* Neither the name of the copyright holder nor the names of its
24+
contributors may be used to endorse or promote products derived from
25+
this software without specific prior written permission.
26+
27+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
28+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
30+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
31+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
33+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
34+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
35+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
36+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

0 commit comments

Comments
 (0)