env_functions¶
Environment functions
check_file_access(filepath, append='_new')
¶
Check path has write access, if not, return appended path with write access
Source code in mmg_toolbox/utils/env_functions.py
get_beamline(default='')
¶
get_data_directory()
¶
Return the default data directory
get_dls_visits(instrument=None, year=None)
¶
Return list of visits
Source code in mmg_toolbox/utils/env_functions.py
get_first_file(folder, extension='.nxs')
¶
get_last_scan_number(folder)
¶
get_notebook_directory(data_directory)
¶
get_processing_directory(data_directory)
¶
get_scan_notebooks(scan, data_directory=None)
¶
Return list of processed jupyter notebooks for scan
Source code in mmg_toolbox/utils/env_functions.py
get_scan_numbers(folder)
¶
Return ordered list of scans numbers from nexus files in directory
Source code in mmg_toolbox/utils/env_functions.py
get_user(default='')
¶
last_folder_update(folder)
¶
open_jupyter_lab()
¶
Open a new terminal and start a Jupyter lab terminal (linux only)
open_terminal(command)
¶
Open a new terminal window (linux only) and run a command
run_command(command)
¶
Run shell command, print output to terminal
Source code in mmg_toolbox/utils/env_functions.py
run_jupyter_notebook(notebook_filename)
¶
run_python_script(script_filename)
¶
run_python_string(script)
¶
Run shell command, print output to terminal
scan_number_mapping(*folders)
¶
Build mapping of scan number to scan file