Skip to content

Commit 4e35c40

Browse files
committed
debugging now
1 parent 6957c51 commit 4e35c40

5 files changed

Lines changed: 17 additions & 11 deletions

File tree

ImageD11/nbGui/S3DXRD/pbp_1_indexing.ipynb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,10 @@
134134
"import numpy as np\n",
135135
"from matplotlib import pyplot as plt\n",
136136
"\n",
137-
"from ImageD11.nbGui.S3DXRD.run_pbp_recon_chunk import merge_chunk_outputs\n",
137+
"try:\n",
138+
" from ImageD11.nbGui.S3DXRD.run_pbp_recon_chunk import merge_chunk_outputs\n",
139+
"except:\n",
140+
" merge_chunk_outputs = None # Old version\n",
138141
"import ImageD11.sinograms.point_by_point\n",
139142
"import ImageD11.sinograms.dataset\n",
140143
"import ImageD11.columnfile\n",
@@ -402,7 +405,7 @@
402405
},
403406
"outputs": [],
404407
"source": [
405-
"if use_cluster:\n",
408+
"if merge_chunk_outputs is not None and use_cluster:\n",
406409
" grains_prefix = ds.pbpfile.replace(ds.analysispath, os.path.join(ds.analysispath, 'slurm_pbp')).replace('.txt', f'_{phase_str}_')\n",
407410
" bash_script_path, grains_files = pbp_object.submit_slurm_chunks(grains_prefix,\n",
408411
" PYTHONPATH,\n",

ImageD11/nbGui/S3DXRD/pbp_2_visualise.ipynb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
},
8181
"outputs": [],
8282
"source": [
83+
"import os\n",
8384
"import numpy as np\n",
8485
"from matplotlib import pyplot as plt\n",
8586
"import matplotlib.cm as cm\n",

ImageD11/nbGui/S3DXRD/tomo_2_map_minor_phase.ipynb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,9 @@
115115
},
116116
"outputs": [],
117117
"source": [
118-
"if IMAGED11_PATH is not None:\n",
119-
" exec(open('/data/id11/nanoscope/install_ImageD11_from_git.py').read())\n",
120-
" PYTHONPATH = setup_ImageD11_from_git(CHECKOUT_PATH, IMAGED11_PATH)\n",
121-
"else:\n",
122-
" PYTHONPATH = None # use the system python"
118+
"# We have to run this at ESRF because the astra slurm script is using it\n",
119+
"exec(open('/data/id11/nanoscope/install_ImageD11_from_git.py').read())\n",
120+
"PYTHONPATH = setup_ImageD11_from_git(CHECKOUT_PATH, IMAGED11_PATH)"
123121
]
124122
},
125123
{

ImageD11/nbGui/install_ImageD11_from_git.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,8 @@ def setup_ImageD11_from_git(path=None, checkout="ImageD11"):
6969
if checkout is None and path is None:
7070
# we assume you want the system python
7171
import ImageD11
72-
73-
folder = os.path.split(ImageD11.__file__)[-1]
74-
pythonpath = os.path.split(folder)[-1]
72+
folder = os.path.split(ImageD11.__file__)[0]
73+
pythonpath = os.path.split(folder)[0]
7574
# probably cvmfs ..., but if it holds /data/
7675
if pythonpath.find("/data/") > 0:
7776
pythonpath = pythonpath[pythonpath.find("/data/") :]

test/papermill_test_notebooks.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,12 @@ def clean_esrf_path(
6464
import ImageD11
6565
checkout_name = None
6666
checkout_folder = None
67-
print("We should be using the system python")
67+
folder = os.path.split(ImageD11.__file__)[0]
68+
pythonpath = os.path.split(folder)[0]
69+
# probably cvmfs ..., but if it holds /data/
70+
if pythonpath.find("/data/") > 0:
71+
pythonpath = pythonpath[pythonpath.find("/data/") :]
72+
print("We should be using the system python", pythonpath)
6873
else:
6974
# If we are working from git, this is where to find the code
7075
items = os.path.abspath(__file__).split( os.path.sep ) # this files location (test)

0 commit comments

Comments
 (0)