Skip to content

Commit

Permalink
Merge pull request #1 from din14970/review
Browse files Browse the repository at this point in the history
Review
  • Loading branch information
din14970 authored Mar 7, 2022
2 parents 8e8170e + 2117c83 commit b626ac8
Show file tree
Hide file tree
Showing 12 changed files with 2,513 additions and 1,595 deletions.
1,481 changes: 372 additions & 1,109 deletions 210903IndexOptimization.ipynb

Large diffs are not rendered by default.

2,200 changes: 1,812 additions & 388 deletions 210907Benchmarking.ipynb

Large diffs are not rendered by default.

28 changes: 10 additions & 18 deletions 210910AdvancedIndexing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 5,
"id": "6df5fe6c",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -155,7 +155,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 6,
"id": "b71ce71c",
"metadata": {},
"outputs": [
Expand All @@ -165,7 +165,7 @@
"<LazyElectronDiffraction2D, title: , dimensions: (260, 200|256, 256)>"
]
},
"execution_count": 4,
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -184,7 +184,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 7,
"id": "e18ad0dd",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -219,17 +219,17 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 8,
"id": "377320d2",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.image.AxesImage at 0x7f993c227dc0>"
"<matplotlib.image.AxesImage at 0x7f64a899bd30>"
]
},
"execution_count": 6,
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
},
Expand Down Expand Up @@ -285,7 +285,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 3,
"id": "5571e021",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -327,7 +327,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 4,
"id": "6fc6f95c",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -974,7 +974,7 @@
},
{
"cell_type": "code",
"execution_count": 29,
"execution_count": 9,
"id": "627396ab",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -3918,14 +3918,6 @@
"source": [
"fig.savefig(\"210903DataImages/210921AnalysisG.png\", dpi=640)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "4ad6ef42",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
16 changes: 8 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,19 @@ RUN conda init bash && \
matplotlib-scalebar=0.7.2 \
scikit-learn=0.24.2 \
lmfit=1.0.2 \
numpy=1.21.2 \
numba=0.53.1 \
numpy=1.20.3 \
numba=0.55.1 \
psutil=5.8.0 \
ipywidgets=7.6.5 \
ipyevents=2.0.1 \
scipy=1.7.1 \
diffpy.structure=3.0.1 \
tqdm=4.62.2 \
transforms3d=0.3.1 \
orix=0.7.0 \
dask=2021.7.1 \
orix=0.8.2 \
dask=2021.9.1 \
h5py=3.3.0 \
hyperspy=1.6.4 \
hyperspy=1.6.5 \
pywget=3.2 \
vtk=9.0.3

Expand All @@ -66,12 +66,12 @@ RUN conda init bash && . /root/.bashrc && conda activate venv && \

# installing the custom packages
RUN conda init bash && . /root/.bashrc && conda activate venv && \
git clone https://github.com/din14970/diffsims.git \
&& cd diffsims && git checkout 29b0715 && pip install -e .
git clone https://github.com/pyxem/diffsims.git \
&& cd diffsims && git checkout 2b75329 && pip install -e .

RUN conda init bash && . /root/.bashrc && conda activate venv && \
git clone https://github.com/pyxem/pyxem.git \
&& cd pyxem && git checkout ca4f58de && pip install -e .
&& cd pyxem && git checkout 30ddc1f5 && pip install -e .

# Add Tini
ENV TINI_VERSION v0.19.0
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ In order to save you some time I have already included an `environment.yml` file

5. Go out of this folder and clone the repositories for pyxem and diffsims
```
$ git clone https://github.com/din14970/diffsims.git
$ git clone https://github.com/pyxem/diffsims.git
```

and
Expand All @@ -85,19 +85,19 @@ In order to save you some time I have already included an `environment.yml` file
```
$ conda activate pyxenv
$ cd diffsims
$ git checkout 29b0715
$ git checkout 2b75329
$ python3 -m pip install -e .
$ cd ../pyxem
$ git checkout ca4f58de
$ git checkout 30ddc1f5
$ python3 -m pip install -e .
```
These steps are necessary because the notebooks use specific features which have not yet been packaged into an official version of the software.

7. You should now be able to launch a Jupyter notebook server with `$ jupyter notebook` and open and run the notebooks. Always ensure the virtual environment is active.

If you want GPU acceleration to work you will need to also install `cupy` with a version >9.0.0.
Additionally you may have to install the appropriate NVIDIA drivers.
Additionally you may have to install the appropriate NVIDIA drivers and the cuda toolkit.
If you can import `cupy` in a notebook and create an array with `cupy.array([1, 2, 3])` without errors, the GPU acceleration should work.

If Mayavi doesn't work on your system you may have to do some digging on required system packages.
Pyxem does not rely on Mayavi, only one image uses this package.
Pyxem does not rely on Mayavi, only one image from the paper relies on this package.
31 changes: 0 additions & 31 deletions data/210921BenchMark.csv

This file was deleted.

31 changes: 0 additions & 31 deletions data/210921BenchMark_gpu.csv

This file was deleted.

10 changes: 10 additions & 0 deletions data/timings_py4dstem.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
,deltaz,s,deltaphi,mean,std,N
0,3.0,16,5.0,0.004885721206665039,0.0002752652265211118,190
1,3.0,16,1.0,0.02255721092224121,9.152533697429926e-05,190
2,3.0,16,0.2,0.11132421493530273,0.0004213860337622292,190
3,1.0,16,5.0,0.046873044967651364,0.00022924351924179484,1596
4,1.0,16,1.0,0.18623886108398438,0.001506090134745518,1596
5,1.0,16,0.2,0.9322866439819336,0.009127655975065572,1596
6,0.5,16,5.0,0.17832255363464355,0.0008546550602958952,6105
7,0.5,16,1.0,0.7188356399536133,0.0024698227241183018,6105
8,0.5,16,0.2,4.888544130325317,2.645356733933859,6105
10 changes: 5 additions & 5 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ dependencies:
- matplotlib-scalebar=0.7.2
- scikit-learn=0.24.2
- lmfit=1.0.2
- numpy=1.21.2
- numba=0.53.1
- numpy=1.20.3
- numba=0.55.1
- psutil=5.8.0
- ipywidgets=7.6.5
- ipyevents=2.0.1
- scipy=1.7.1
- diffpy.structure=3.0.1
- tqdm=4.62.2
- transforms3d=0.3.1
- orix=0.7.0
- dask=2021.7.1
- orix=0.8.2
- dask=2021.9.1
- h5py=3.3.0
- hyperspy=1.6.4
- hyperspy=1.6.5
- pywget=3.2
- vtk=9.0.3
- mayavi=4.7.2
97 changes: 97 additions & 0 deletions pyxem_cpu_time.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
,nk,dt,spot,mean,std
0,1.0,5.0,10.0,0.0009750843048095704,0.00016668261481970342
1,500.0,5.0,10.0,0.0010495662689208984,5.4216280042132594e-05
2,1000.0,5.0,10.0,0.0011636734008789063,7.457333746749048e-05
3,3000.0,5.0,10.0,0.0016612529754638672,0.00019325118783505618
4,6000.0,5.0,10.0,0.0021773338317871093,0.00013011011937135382
5,10000.0,5.0,10.0,0.0029830455780029295,0.00021330191964633887
6,1.0,1.0,10.0,0.0032835960388183593,0.00021904290156388919
7,500.0,1.0,10.0,0.00366668701171875,0.00010657938782948394
8,1000.0,1.0,10.0,0.0041717529296875,0.00012126547386721986
9,3000.0,1.0,10.0,0.006126213073730469,0.0001888769017763666
10,6000.0,1.0,10.0,0.010163593292236327,0.0013017413500418416
11,10000.0,1.0,10.0,0.01387925148010254,0.0004819866457048332
12,1.0,0.5,10.0,0.006396627426147461,0.00026781403518105946
13,500.0,0.5,10.0,0.007372474670410157,0.0001423692823825842
14,1000.0,0.5,10.0,0.008417558670043946,0.00014718082327600226
15,3000.0,0.5,10.0,0.012852239608764648,0.0003928169749177346
16,6000.0,0.5,10.0,0.019764232635498046,0.0004652973569105251
17,10000.0,0.5,10.0,0.025625991821289062,0.0023692959480495143
18,1.0,0.2,10.0,0.01591634750366211,0.00019035772947445412
19,500.0,0.2,10.0,0.018506669998168947,0.0003587176123105336
20,1000.0,0.2,10.0,0.020955562591552734,0.0002016815441090939
21,3000.0,0.2,10.0,0.030830860137939453,0.0001627408965271649
22,6000.0,0.2,10.0,0.04385609626770019,0.004627183023976892
23,10000.0,0.2,10.0,0.049824190139770505,0.0036660081951004333
24,1.0,5.0,50.0,0.001027059555053711,0.0002034890155832569
25,500.0,5.0,50.0,0.0014007091522216797,5.4367173631331836e-05
26,1000.0,5.0,50.0,0.0018655776977539063,7.488065266462193e-05
27,3000.0,5.0,50.0,0.0037528038024902343,0.00021704759018928075
28,6000.0,5.0,50.0,0.006421327590942383,0.0001445263456727972
29,10000.0,5.0,50.0,0.01020827293395996,0.00016498728293791622
30,1.0,1.0,50.0,0.003345012664794922,0.00028830435812879113
31,500.0,1.0,50.0,0.005514764785766601,0.00016382063790437314
32,1000.0,1.0,50.0,0.007714986801147461,0.00013940210155914692
33,3000.0,1.0,50.0,0.016933107376098634,0.0006501747235157742
34,6000.0,1.0,50.0,0.022907209396362305,0.004167753208973161
35,10000.0,1.0,50.0,0.029981660842895507,0.0021326553143220586
36,1.0,0.5,50.0,0.006551933288574219,0.000245341425000668
37,500.0,0.5,50.0,0.010955047607421876,0.00010731520846669102
38,1000.0,0.5,50.0,0.015275716781616211,0.0001363586702255423
39,3000.0,0.5,50.0,0.029222774505615234,0.0024929207266455645
40,6000.0,0.5,50.0,0.03679523468017578,0.0006402036817991127
41,10000.0,0.5,50.0,0.055521488189697266,0.0011017629988127762
42,1.0,0.2,50.0,0.017938566207885743,0.0015272205042854538
43,500.0,0.2,50.0,0.027001714706420897,0.001460285179480585
44,1000.0,0.2,50.0,0.042170047760009766,0.004065279175922692
45,3000.0,0.2,50.0,0.06673712730407715,0.007968992120469011
46,6000.0,0.2,50.0,0.09306583404541016,0.0016553299759466018
47,10000.0,0.2,50.0,0.14250731468200684,0.00116036040132963
48,1.0,5.0,100.0,0.0010333538055419921,0.00017121411708239314
49,500.0,5.0,100.0,0.0019385337829589844,9.935396238016628e-05
50,1000.0,5.0,100.0,0.002714109420776367,6.89417159222898e-05
51,3000.0,5.0,100.0,0.0063759803771972655,0.00010943567569942766
52,6000.0,5.0,100.0,0.012655258178710938,0.0005507776119711985
53,10000.0,5.0,100.0,0.016904544830322266,0.002153792555005657
54,1.0,1.0,100.0,0.003324460983276367,0.0002726852981772546
55,500.0,1.0,100.0,0.008032131195068359,0.00042982180260788493
56,1000.0,1.0,100.0,0.011989355087280273,0.00010177977164361348
57,3000.0,1.0,100.0,0.02587924003601074,0.0026925909558565024
58,6000.0,1.0,100.0,0.039633560180664065,0.004877773431685792
59,10000.0,1.0,100.0,0.052789306640625,0.0006123411748708224
60,1.0,0.5,100.0,0.006461811065673828,0.0003997452029832336
61,500.0,0.5,100.0,0.015257167816162109,0.0006027447154559819
62,1000.0,0.5,100.0,0.023239707946777342,0.001907041528535299
63,3000.0,0.5,100.0,0.04076199531555176,0.004392437923174055
64,6000.0,0.5,100.0,0.0685701847076416,0.004451747690393486
65,10000.0,0.5,100.0,0.10606794357299805,0.001196824348685808
66,1.0,0.2,100.0,0.017359399795532228,0.00014717527712633033
67,500.0,0.2,100.0,0.04104504585266113,0.0013046591215061924
68,1000.0,0.2,100.0,0.05139164924621582,0.007877900323442289
69,3000.0,0.2,100.0,0.1003960132598877,0.0029590204238183373
70,6000.0,0.2,100.0,0.17564587593078612,0.002353830769526858
71,10000.0,0.2,100.0,0.283032751083374,0.006142739900811599
72,1.0,5.0,300.0,0.0009912014007568359,0.000181771212832832
73,500.0,5.0,300.0,0.00374455451965332,0.0003165857026608499
74,1000.0,5.0,300.0,0.006330728530883789,0.00010153194526526067
75,3000.0,5.0,300.0,0.017424726486206056,0.0013393601334843843
76,6000.0,5.0,300.0,0.023198938369750975,0.004730555554030084
77,10000.0,5.0,300.0,0.033063745498657225,0.0026307705087082714
78,1.0,1.0,300.0,0.0037030696868896483,0.00046838809929577736
79,500.0,1.0,300.0,0.01625399589538574,0.00016940148585536336
80,1000.0,1.0,300.0,0.02419443130493164,0.004465648396523509
81,3000.0,1.0,300.0,0.047268915176391604,0.0016541280769990078
82,6000.0,1.0,300.0,0.09505491256713867,0.008694401336927003
83,10000.0,1.0,300.0,0.14791460037231446,0.0005346096413008979
84,1.0,0.5,300.0,0.006857156753540039,0.0005134311191665051
85,500.0,0.5,300.0,0.03146138191223145,0.0036125588836476074
86,1000.0,0.5,300.0,0.036056232452392575,0.0008635761114410822
87,3000.0,0.5,300.0,0.100128173828125,0.009041021114708121
88,6000.0,0.5,300.0,0.18139424324035644,0.0023396780975685006
89,10000.0,0.5,300.0,0.301880931854248,0.013699028990297579
90,1.0,0.2,300.0,0.017338275909423828,9.001013430791187e-05
91,500.0,0.2,300.0,0.05988192558288574,0.010988638970322128
92,1000.0,0.2,300.0,0.0960545539855957,0.011080007397842229
93,3000.0,0.2,300.0,0.23975582122802735,0.003092243766307197
94,6000.0,0.2,300.0,0.46497411727905275,0.013029797721738162
95,10000.0,0.2,300.0,0.7605817317962646,0.012407315420603273
Loading

0 comments on commit b626ac8

Please sign in to comment.