-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1827 from McStasMcXtrace/willend-pygen-minor-revi…
…sion pygen minor revision: Build importable make() function and call from generic notebook
- Loading branch information
Showing
8 changed files
with
265 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,7 +53,6 @@ Source: "dist\mcstas-tools-python-mcdisplay-pyqtgraph-NSIS64-@[email protected] | |
Source: "dist\mcstas-tools-python-mcdisplay-matplotlib-NSIS64-@[email protected]"; DestDir: "{tmp}" | ||
Source: "dist\mcstas-tools-python-mcdisplay-mantid-NSIS64-@[email protected]"; DestDir: "{tmp}" | ||
Source: "dist\mcstas-tools-python-mcdoc-NSIS64-@[email protected]"; DestDir: "{tmp}" | ||
Source: "dist\mcstas-mcpl-NSIS64-@[email protected]"; DestDir: "{tmp}" | ||
Source: "Support\Miniforge3-Windows-x86_64.exe"; DestDir: "{tmp}" | ||
|
||
[Run] | ||
|
@@ -76,7 +75,6 @@ Filename: "{tmp}\mcstas-tools-python-mcdisplay-pyqtgraph-NSIS64-@VERSION@-mingw6 | |
Filename: "{tmp}\mcstas-tools-python-mcdisplay-matplotlib-NSIS64-@[email protected]"; Parameters: "/S" | ||
Filename: "{tmp}\mcstas-tools-python-mcdisplay-mantid-NSIS64-@[email protected]"; Parameters: "/S" | ||
Filename: "{tmp}\mcstas-tools-python-mcdoc-NSIS64-@[email protected]"; Parameters: "/S" | ||
Filename: "{tmp}\mcstas-mcpl-NSIS64-@[email protected]"; Parameters: "/S" | ||
Filename: "{tmp}\docupdate.bat"; | ||
|
||
; NOTE: Don't use "Flags: ignoreversion" on any shared system files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,7 +48,6 @@ Source: "dist\mcxtrace-tools-python-mxdisplay-webgl-NSIS64-@[email protected] | |
Source: "dist\mcxtrace-tools-python-mxdisplay-pyqtgraph-NSIS64-@[email protected]"; DestDir: "{tmp}" | ||
Source: "dist\mcxtrace-tools-python-mxdisplay-matplotlib-NSIS64-@[email protected]"; DestDir: "{tmp}" | ||
Source: "dist\mcxtrace-tools-python-mxdoc-NSIS64-@[email protected]"; DestDir: "{tmp}" | ||
Source: "dist\mcxtrace-mcpl-NSIS64-@[email protected]"; DestDir: "{tmp}" | ||
Source: "Support\Miniforge3-Windows-x86_64.exe"; DestDir: "{tmp}" | ||
|
||
[Run] | ||
|
@@ -66,7 +65,6 @@ Filename: "{tmp}\mcxtrace-tools-python-mxdisplay-webgl-NSIS64-@VERSION@-mingw64. | |
Filename: "{tmp}\mcxtrace-tools-python-mxdisplay-pyqtgraph-NSIS64-@[email protected]"; Parameters: "/S" | ||
Filename: "{tmp}\mcxtrace-tools-python-mxdisplay-matplotlib-NSIS64-@[email protected]"; Parameters: "/S" | ||
Filename: "{tmp}\mcxtrace-tools-python-mxdoc-NSIS64-@[email protected]"; Parameters: "/S" | ||
Filename: "{tmp}\mcxtrace-mcpl-NSIS64-@[email protected]"; Parameters: "/S" | ||
Filename: "{tmp}\docupdate.bat"; | ||
|
||
; NOTE: Don't use "Flags: ignoreversion" on any shared system files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,8 @@ channels: | |
|
||
dependencies: | ||
- m2-msys2-runtime | ||
- m2-which | ||
- m2-sed | ||
- m2w64-gcc | ||
- m2w64-gsl | ||
- msmpi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,159 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import mcstasscript as ms\n", | ||
"from INSTRUMENT_generated import make" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"instr=make()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Use instr.settings() to add e.g. seed=1000, ncount=1e7, mpi=8, openacc=True, force_compile=False etc.)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Show diagram\n", | ||
"instr.show_diagram()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Visualise with default parameters (defaults to 'window'/pyqtgraph visualisation)\n", | ||
"instr.show_instrument(format='window')" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Generate a dataset with default parameters.\n", | ||
"data = instr.backengine()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Overview plot:\n", | ||
"ms.make_sub_plot(data)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Other useful commands follow...\n", | ||
"# One plot pr. window\n", | ||
"#ms.make_plot(data)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Load another dataset\n", | ||
"#data2 = ms.load_data('some_other_folder')" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Adjusting a specific plot\n", | ||
"#ms.name_plot_options(\\\"PSD_4PI\\\", data, log=1, colormap=\\\"hot\\\", orders_of_mag=5)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Bring up the 'interface' - only relevant in Jupyter\n", | ||
"#%matplotlib widget\n", | ||
"#import mcstasscript.jb_interface as ms_widget\n", | ||
"#ms_widget.show(data)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Bring up the simulation 'interface' - only relevant in Jupyter\n", | ||
"#%matplotlib widget\n", | ||
"#import mcstasscript.jb_interface as ms_widget\n", | ||
"#sim_widget = ms_widget.SimInterface(instr)\n", | ||
"#sim_widget.show_interface()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Acessing data from the interface\n", | ||
"#data = sim_widget.get_data()" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.10.14" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |