Updating the readme file
This commit is contained in:
1 parent
aa420e5e4f
commit
558e2f160f
3 files changed
+89
-32
No files matched your search
@@ -137,3 +137,15 @@ Then git operates as follows:
|
|||||||
| `git add .` | Stage changes of all modified files in `git` repo |
|
| `git add .` | Stage changes of all modified files in `git` repo |
|
||||||
| `git commit -m "Message"` | Commit the staged changes with the pertaining commit message "Message" |
|
| `git commit -m "Message"` | Commit the staged changes with the pertaining commit message "Message" |
|
||||||
| `git push -u origin main` | Push changes to remote on branch `main`. Normally it suffices to just run `git push`, but specifying the branches is required when there are several of them... |
|
| `git push -u origin main` | Push changes to remote on branch `main`. Normally it suffices to just run `git push`, but specifying the branches is required when there are several of them... |
|
||||||
|
|
||||||
|
To remove files from the remote repository which are not desired (i.e. wrong entry in the gitignore file), update the gitignore file and then run
|
||||||
|
|
||||||
|
```
|
||||||
|
git add *
|
||||||
|
git commit -m "Some commit message"
|
||||||
|
git push
|
||||||
|
git rm -r --cached
|
||||||
|
git add *
|
||||||
|
git commit -m "Some new commit message where the undesired files are now no longer there..."
|
||||||
|
git push
|
||||||
|
```
|
||||||
+74
@@ -21,6 +21,7 @@ import datetime
|
|||||||
import warnings
|
import warnings
|
||||||
from scipy.optimize import curve_fit
|
from scipy.optimize import curve_fit
|
||||||
from defs.Helper import compute_R2
|
from defs.Helper import compute_R2
|
||||||
|
import re
|
||||||
|
|
||||||
### ----------------------------------------------------------------------------------------------------------------------------------- ###
|
### ----------------------------------------------------------------------------------------------------------------------------------- ###
|
||||||
### TOC.py
|
### TOC.py
|
||||||
@@ -359,3 +360,76 @@ class Calibration():
|
|||||||
|
|
||||||
def compute(self, sample_areas):
|
def compute(self, sample_areas):
|
||||||
return self.curve.compute(sample_areas=sample_areas)
|
return self.curve.compute(sample_areas=sample_areas)
|
||||||
|
|
||||||
|
def TXTFileTransformer(file: Path, headline = 11, paketsize = 3, to_clipboard = True):
|
||||||
|
|
||||||
|
methods = [] # column 1
|
||||||
|
sample_names = [] # column 2
|
||||||
|
comments = [] # column 6
|
||||||
|
vials = [] # column 21
|
||||||
|
date_times_1 = [] # column 7
|
||||||
|
date_times_2 = [] # column 7
|
||||||
|
date_times_3 = [] # column 7
|
||||||
|
areas_1 = [] # column 11
|
||||||
|
areas_2 = [] # column 11
|
||||||
|
areas_3 = [] # column 11
|
||||||
|
concentrations_1 = [] # column 13
|
||||||
|
concentrations_2 = [] # column 13
|
||||||
|
concentrations_3 = [] # column 13
|
||||||
|
|
||||||
|
with open(file = file, errors='ignore', mode = 'r') as f:
|
||||||
|
|
||||||
|
for index, line in enumerate(f.readlines()):
|
||||||
|
|
||||||
|
if index < headline:
|
||||||
|
continue
|
||||||
|
|
||||||
|
else:
|
||||||
|
|
||||||
|
items = re.split(r'\t', line)[:-1]
|
||||||
|
|
||||||
|
# first sample
|
||||||
|
if (index - headline) % paketsize == 0:
|
||||||
|
|
||||||
|
|
||||||
|
methods.append(str(items[1]))
|
||||||
|
sample_names.append(str(items[2]))
|
||||||
|
comments.append(str(items[6]))
|
||||||
|
vials.append(int(items[21]))
|
||||||
|
|
||||||
|
date_times_1.append(pd.to_datetime(str(items[7]), format=r'%m/%d/%Y %I:%M:%S %p'))
|
||||||
|
areas_1.append(float(items[11]))
|
||||||
|
concentrations_1.append(float(items[13]))
|
||||||
|
|
||||||
|
# second sample
|
||||||
|
elif (index - headline) % paketsize == 1:
|
||||||
|
|
||||||
|
date_times_2.append(pd.to_datetime(str(items[7]), format=r'%m/%d/%Y %I:%M:%S %p'))
|
||||||
|
areas_2.append(float(items[11]))
|
||||||
|
concentrations_2.append(float(items[13]))
|
||||||
|
|
||||||
|
# third sample
|
||||||
|
elif (index - headline) % paketsize == 2:
|
||||||
|
|
||||||
|
date_times_3.append(pd.to_datetime(str(items[7]), format=r'%m/%d/%Y %I:%M:%S %p'))
|
||||||
|
areas_3.append(float(items[11]))
|
||||||
|
concentrations_3.append(float(items[13]))
|
||||||
|
|
||||||
|
out_frame = pd.DataFrame({'method': methods,
|
||||||
|
'sample': sample_names,
|
||||||
|
'comment': comments,
|
||||||
|
'vial': vials,
|
||||||
|
'datetime_1': date_times_1,
|
||||||
|
'datetime_2': date_times_2,
|
||||||
|
'datetime_3': date_times_3,
|
||||||
|
'area_1': areas_1,
|
||||||
|
'area_2': areas_2,
|
||||||
|
'area_3': areas_3,
|
||||||
|
'concentration_1': concentrations_1,
|
||||||
|
'concentration_2': concentrations_2,
|
||||||
|
'concentration_3': concentrations_3})
|
||||||
|
|
||||||
|
if to_clipboard:
|
||||||
|
out_frame.to_clipboard(excel=True, index=False)
|
||||||
|
else:
|
||||||
|
return out_frame
|
||||||
@@ -1,33 +1,4 @@
|
|||||||
import matplotlib
|
from defs.TOC import TXTFileTransformer
|
||||||
import matplotlib.pyplot as plt
|
from pathlib import Path
|
||||||
|
|
||||||
matplotlib.use('pgf')
|
TXTFileTransformer(file=Path(r"c:\Users\tschan_d\Documents\analysis\TOC_Analysis\20260923\20260923_DT_SOA_Extract_Measurement_01_detail.txt"))
|
||||||
matplotlib.rcParams.update({'text.usetex': True,
|
|
||||||
'pgf.rcfonts': False,
|
|
||||||
'font.family': 'serif',
|
|
||||||
'font.serif': [],
|
|
||||||
'font.sans-serif': [],
|
|
||||||
'font.size': 6,
|
|
||||||
#'legend.fontsize': 6,
|
|
||||||
'legend.handlelength': 2,
|
|
||||||
#'xtick.labelsize': 6,
|
|
||||||
#'ytick.labelsize': 6,
|
|
||||||
'pgf.texsystem': r'lualatex',
|
|
||||||
'pgf.preamble': r'\usepackage{scrextend}' +
|
|
||||||
r'\usepackage{unicode-math}' +
|
|
||||||
r'\usepackage{accents}' +
|
|
||||||
r'\usepackage{fontspec}' +
|
|
||||||
r'\usepackage[T1]{fontenc}' +
|
|
||||||
r'\usepackage{unicode-math}' +
|
|
||||||
r'\setmainfont{STIX Two Text}' +
|
|
||||||
r'\setmathfont{STIX Two Math}' +
|
|
||||||
r'\usepackage{siunitx}' +
|
|
||||||
r'\usepackage{mhchem}' +
|
|
||||||
r'\newcommand{\der}[1]{\ensuremath{\textnormal{d}\,{#1}}}'})
|
|
||||||
|
|
||||||
plt.figure()
|
|
||||||
plt.plot([], label=r'$this is a very very long math label a\times b$ and some text')
|
|
||||||
plt.legend()
|
|
||||||
plt.savefig('figure.png')
|
|
||||||
plt.savefig('figure.pgf')
|
|
||||||
plt.close()
|
|
||||||
Reference in new issue
Block a user