Skip to content
Snippets Groups Projects
Commit 2c859f18 authored by Mr. SQUID's avatar Mr. SQUID
Browse files

now copy plot all my data into their data folder too

parent 0cc87212
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
......@@ -112,16 +112,16 @@ folder = academic_year + "_round_%02d/" % practicum_round
if not os.path.exists(folder):
os.makedirs(folder)
# The source code from the git repository
gitfolder = "../../Documents/GitHub/rp-squid-python-code/"
# Copy the latest copy of the example analysis code to a subfolder
if not os.path.exists(folder+"analysis_code/"):
shutil.copytree(gitfolder + "/analysis_code/", folder+"analysis_code/")
# Copy the autoplot library to the working round folder
if not os.path.exists(folder+"autplot.py"):
shutil.copy2(gitfolder + "/analysis_code/autoplot.py", folder+"autoplot.py")
# And put these in the top level folder
for file in "autoplot.py", "Plot all my data.ipynb":
if not os.path.exists(folder+file):
shutil.copy2(gitfolder + "/analysis_code/" + file , folder+file)
```
<!-- #region hide_input=false -->
......@@ -643,7 +643,7 @@ def save_data(w):
fmt = f"mrsquid_PSD_%Y-%m-%d-%H_%M_%S.dat"
header = "# I_avg %e I_ptp %e V_avg %e V_ptp %e" % (I_avg, I_ptp, V_avg, V_ptp )
outname = folder + "/" + datetime.now().strftime(fmt)
np.savetxt(outname, np.array([f,I_psd,V_psd]).T)
np.savetxt(outname, np.array([f,I_psd,V_psd]).T, header=header)
filename.value = outname
save_button = widgets.Button(description='Save data')
......
%% Cell type:code id: tags:
``` python
import os
import shutil
```
%% Cell type:markdown id: tags:
Using this, we can just make edits to the software in the folder where the students will run it and use this to get a copy of the updated code into the git repo.
%% Cell type:code id: tags:
``` python
os.remove("SQUID measurement software.ipynb")
os.remove("SQUID measurement software.md")
source = "../../../Delft University of Technology/TN2953-P QN Squid Practicum - data/SQUID measurement software.ipynb"
shutil.copy2(source, ".")
```
%% Output
'.\\SQUID measurement software.ipynb'
%% Cell type:code id: tags:
%% Cell type:markdown id: tags:
``` python
```
After copying the new notebook file over, you should open it and then save it to regenerate the md file before pushing.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment