Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
- take intensity bug
- STOCSY bug
  • Loading branch information
aeiwz committed Jan 21, 2025
1 parent 8588047 commit 62053e6
Show file tree
Hide file tree
Showing 7 changed files with 287 additions and 248 deletions.
Binary file added metbit/__pycache__/STOCSY.cpython-313.pyc
Binary file not shown.
Binary file added metbit/__pycache__/metbit.cpython-313.pyc
Binary file not shown.
244 changes: 244 additions & 0 deletions metbit/dev/test_peak.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -922,6 +922,250 @@
"source": [
"plot_NMR_spec(spectra=df2, ppm = ppm, label=None).single_spectra()"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"import numpy as np\n",
"\n",
"#random data for 100 x 1000\n",
"df = pd.DataFrame(np.random.rand(100, 1000))\n"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>0</th>\n",
" <th>1</th>\n",
" <th>2</th>\n",
" <th>3</th>\n",
" <th>4</th>\n",
" <th>5</th>\n",
" <th>6</th>\n",
" <th>7</th>\n",
" <th>8</th>\n",
" <th>9</th>\n",
" <th>...</th>\n",
" <th>990</th>\n",
" <th>991</th>\n",
" <th>992</th>\n",
" <th>993</th>\n",
" <th>994</th>\n",
" <th>995</th>\n",
" <th>996</th>\n",
" <th>997</th>\n",
" <th>998</th>\n",
" <th>999</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>82</th>\n",
" <td>0.796301</td>\n",
" <td>0.542752</td>\n",
" <td>0.879767</td>\n",
" <td>0.414274</td>\n",
" <td>0.852321</td>\n",
" <td>0.962625</td>\n",
" <td>0.364203</td>\n",
" <td>0.568212</td>\n",
" <td>0.753244</td>\n",
" <td>0.977790</td>\n",
" <td>...</td>\n",
" <td>0.088030</td>\n",
" <td>0.160424</td>\n",
" <td>0.540365</td>\n",
" <td>0.595766</td>\n",
" <td>0.778216</td>\n",
" <td>0.797282</td>\n",
" <td>0.394352</td>\n",
" <td>0.677654</td>\n",
" <td>0.846243</td>\n",
" <td>0.515333</td>\n",
" </tr>\n",
" <tr>\n",
" <th>59</th>\n",
" <td>0.441169</td>\n",
" <td>0.311394</td>\n",
" <td>0.967183</td>\n",
" <td>0.116487</td>\n",
" <td>0.850167</td>\n",
" <td>0.459365</td>\n",
" <td>0.421279</td>\n",
" <td>0.790957</td>\n",
" <td>0.904389</td>\n",
" <td>0.951303</td>\n",
" <td>...</td>\n",
" <td>0.401897</td>\n",
" <td>0.975459</td>\n",
" <td>0.464860</td>\n",
" <td>0.334351</td>\n",
" <td>0.316639</td>\n",
" <td>0.301374</td>\n",
" <td>0.971110</td>\n",
" <td>0.036026</td>\n",
" <td>0.527075</td>\n",
" <td>0.690774</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>0.422536</td>\n",
" <td>0.348928</td>\n",
" <td>0.213346</td>\n",
" <td>0.894253</td>\n",
" <td>0.728559</td>\n",
" <td>0.804165</td>\n",
" <td>0.519382</td>\n",
" <td>0.575276</td>\n",
" <td>0.737128</td>\n",
" <td>0.634928</td>\n",
" <td>...</td>\n",
" <td>0.924129</td>\n",
" <td>0.692955</td>\n",
" <td>0.803428</td>\n",
" <td>0.780486</td>\n",
" <td>0.658131</td>\n",
" <td>0.982438</td>\n",
" <td>0.032135</td>\n",
" <td>0.142376</td>\n",
" <td>0.003578</td>\n",
" <td>0.289351</td>\n",
" </tr>\n",
" <tr>\n",
" <th>18</th>\n",
" <td>0.836070</td>\n",
" <td>0.834373</td>\n",
" <td>0.663030</td>\n",
" <td>0.902761</td>\n",
" <td>0.033723</td>\n",
" <td>0.991070</td>\n",
" <td>0.224448</td>\n",
" <td>0.371660</td>\n",
" <td>0.411484</td>\n",
" <td>0.097740</td>\n",
" <td>...</td>\n",
" <td>0.636109</td>\n",
" <td>0.354969</td>\n",
" <td>0.240294</td>\n",
" <td>0.233445</td>\n",
" <td>0.127109</td>\n",
" <td>0.794130</td>\n",
" <td>0.098487</td>\n",
" <td>0.581847</td>\n",
" <td>0.512348</td>\n",
" <td>0.324953</td>\n",
" </tr>\n",
" <tr>\n",
" <th>56</th>\n",
" <td>0.151065</td>\n",
" <td>0.182319</td>\n",
" <td>0.317860</td>\n",
" <td>0.877142</td>\n",
" <td>0.212846</td>\n",
" <td>0.582252</td>\n",
" <td>0.544011</td>\n",
" <td>0.187960</td>\n",
" <td>0.313838</td>\n",
" <td>0.009722</td>\n",
" <td>...</td>\n",
" <td>0.205116</td>\n",
" <td>0.911063</td>\n",
" <td>0.001677</td>\n",
" <td>0.074687</td>\n",
" <td>0.217369</td>\n",
" <td>0.856486</td>\n",
" <td>0.644676</td>\n",
" <td>0.731753</td>\n",
" <td>0.322994</td>\n",
" <td>0.770325</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>5 rows × 1000 columns</p>\n",
"</div>"
],
"text/plain": [
" 0 1 2 3 4 5 6 \\\n",
"82 0.796301 0.542752 0.879767 0.414274 0.852321 0.962625 0.364203 \n",
"59 0.441169 0.311394 0.967183 0.116487 0.850167 0.459365 0.421279 \n",
"1 0.422536 0.348928 0.213346 0.894253 0.728559 0.804165 0.519382 \n",
"18 0.836070 0.834373 0.663030 0.902761 0.033723 0.991070 0.224448 \n",
"56 0.151065 0.182319 0.317860 0.877142 0.212846 0.582252 0.544011 \n",
"\n",
" 7 8 9 ... 990 991 992 993 \\\n",
"82 0.568212 0.753244 0.977790 ... 0.088030 0.160424 0.540365 0.595766 \n",
"59 0.790957 0.904389 0.951303 ... 0.401897 0.975459 0.464860 0.334351 \n",
"1 0.575276 0.737128 0.634928 ... 0.924129 0.692955 0.803428 0.780486 \n",
"18 0.371660 0.411484 0.097740 ... 0.636109 0.354969 0.240294 0.233445 \n",
"56 0.187960 0.313838 0.009722 ... 0.205116 0.911063 0.001677 0.074687 \n",
"\n",
" 994 995 996 997 998 999 \n",
"82 0.778216 0.797282 0.394352 0.677654 0.846243 0.515333 \n",
"59 0.316639 0.301374 0.971110 0.036026 0.527075 0.690774 \n",
"1 0.658131 0.982438 0.032135 0.142376 0.003578 0.289351 \n",
"18 0.127109 0.794130 0.098487 0.581847 0.512348 0.324953 \n",
"56 0.217369 0.856486 0.644676 0.731753 0.322994 0.770325 \n",
"\n",
"[5 rows x 1000 columns]"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df.sample(5)"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"([1, 2, 4, 6, 23, 25], ['4', '2', '1', '23', '25', '6'])"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"d = [1,23,25,4,6,4,1,1,2]\n",
"f = [str(x) for x in d]\n",
"list(set(d)), list(set(f))"
]
}
],
"metadata": {
Expand Down
Loading

0 comments on commit 62053e6

Please sign in to comment.