Skip to content

Commit

Permalink
dummy_circles use prrng
Browse files Browse the repository at this point in the history
  • Loading branch information
tdegeus committed Nov 23, 2023
1 parent 661a6de commit 7446da8
Show file tree
Hide file tree
Showing 55 changed files with 16,867 additions and 17,021 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ endif()
# Set target
# ==========

find_package(prrng REQUIRED)
find_package(xtensor REQUIRED)

add_library(${PROJECT_NAME} INTERFACE)
Expand All @@ -52,6 +53,7 @@ target_include_directories(${PROJECT_NAME} INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)

target_compile_features(${PROJECT_NAME} INTERFACE cxx_std_17)
target_link_libraries(${PROJECT_NAME} INTERFACE prrng)
target_link_libraries(${PROJECT_NAME} INTERFACE xtensor)

target_compile_definitions(${PROJECT_NAME} INTERFACE
Expand Down
1 change: 1 addition & 0 deletions GooseEYEConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ endif()

# Find dependencies

find_dependency(prrng)
find_dependency(xtensor)

# Define support target "GooseEYE::compiler_warnings"
Expand Down
Binary file modified docs/examples/C2.h5
Binary file not shown.
36 changes: 16 additions & 20 deletions docs/examples/C2.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
r"""
Plot and/or check.
Usage:
script [options]
Options:
-s, --save Save output for later check.
-c, --check Check against earlier results.
-p, --plot Plot.
-h, --help Show this help.
"""
# <snippet>
import GooseEYE
import numpy as np
Expand All @@ -29,27 +17,34 @@
# </snippet>

if __name__ == "__main__":
import docopt
import argparse
import pathlib

args = docopt.docopt(__doc__)
root = pathlib.Path(__file__).parent

if args["--save"]:
parser = argparse.ArgumentParser()
parser.add_argument("--save", action="store_true")
parser.add_argument("--check", action="store_true")
parser.add_argument("--plot", action="store_true")
args = parser.parse_args()

if args.save:
import h5py

with h5py.File("C2.h5", "w") as data:
with h5py.File(root / "C2.h5", "w") as data:
data["I"] = img
data["C"] = C
data["C2"] = C2

if args["--check"]:
if args.check:
import h5py

with h5py.File("C2.h5", "r") as data:
with h5py.File(root / "C2.h5", "r") as data:
assert np.all(np.equal(data["I"][...], img))
assert np.all(np.equal(data["C"][...], C))
assert np.allclose(data["C2"][...], C2)

if args["--plot"]:
if args.plot:
import matplotlib.pyplot as plt
import matplotlib as mpl
import matplotlib.cm as cm
Expand Down Expand Up @@ -141,4 +136,5 @@
ax.set_xlabel(r"$\Delta x$")
ax.set_ylabel(r"$C_2$")

plt.savefig("C2.svg")
fig.savefig(root / "C2.svg")
plt.close(fig)
2,139 changes: 1,070 additions & 1,069 deletions docs/examples/C2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/examples/L.h5
Binary file not shown.
37 changes: 16 additions & 21 deletions docs/examples/L.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
r"""
Plot and/or check.
Usage:
script [options]
Options:
-s, --save Save output for later check.
-c, --check Check against earlier results.
-p, --plot Plot.
-h, --help Show this help.
"""
# <snippet>
import GooseEYE
import numpy as np
Expand All @@ -23,25 +11,32 @@
# </snippet>

if __name__ == "__main__":
import docopt
import argparse
import pathlib

args = docopt.docopt(__doc__)
root = pathlib.Path(__file__).parent

if args["--save"]:
parser = argparse.ArgumentParser()
parser.add_argument("--save", action="store_true")
parser.add_argument("--check", action="store_true")
parser.add_argument("--plot", action="store_true")
args = parser.parse_args()

if args.save:
import h5py

with h5py.File("L.h5", "w") as data:
with h5py.File(root / "L.h5", "w") as data:
data["I"] = img
data["L"] = L

if args["--check"]:
if args.check:
import h5py

with h5py.File("L.h5", "r") as data:
with h5py.File(root / "L.h5", "r") as data:
assert np.all(np.equal(data["I"][...], img))
assert np.allclose(data["L"][...], L)

if args["--plot"]:
if args.plot:
import matplotlib.pyplot as plt
import matplotlib as mpl
import matplotlib.cm as cm
Expand Down Expand Up @@ -89,5 +84,5 @@
ax.set_xlabel(r"$\Delta x$")
ax.set_ylabel(r"$L$")

plt.savefig("L.svg")
plt.close()
fig.savefig(root / "L.svg")
plt.close(fig)
1,129 changes: 565 additions & 564 deletions docs/examples/L.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/examples/S2.h5
Binary file not shown.
44 changes: 20 additions & 24 deletions docs/examples/S2.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
r"""
Plot and/or check.
Usage:
script [options]
Options:
-s, --save Save output for later check.
-c, --check Check against earlier results.
-p, --plot Plot.
-h, --help Show this help.
"""
# <snippet>
import GooseEYE
import numpy as np
Expand All @@ -23,25 +11,32 @@
# </snippet>

if __name__ == "__main__":
import docopt
import argparse
import pathlib

args = docopt.docopt(__doc__)
root = pathlib.Path(__file__).parent

if args["--save"]:
parser = argparse.ArgumentParser()
parser.add_argument("--save", action="store_true")
parser.add_argument("--check", action="store_true")
parser.add_argument("--plot", action="store_true")
args = parser.parse_args()

if args.save:
import h5py

with h5py.File("S2.h5", "w") as data:
data["I"] = img
data["S2"] = S2
with h5py.File(root / "S2.h5", "w") as file:
file["I"] = img
file["S2"] = S2

if args["--check"]:
if args.check:
import h5py

with h5py.File("S2.h5", "r") as data:
assert np.all(np.equal(data["I"][...], img))
assert np.allclose(data["S2"][...], S2)
with h5py.File(root / "S2.h5", "r") as file:
assert np.all(np.equal(file["I"][...], img))
assert np.allclose(file["S2"][...], S2)

if args["--plot"]:
if args.plot:
import matplotlib.pyplot as plt
import matplotlib as mpl
import matplotlib.cm as cm
Expand Down Expand Up @@ -90,4 +85,5 @@
ax.set_xlabel(r"$\Delta x$")
ax.set_ylabel(r"$S_2$")

plt.savefig("S2.svg")
fig.savefig(root / "S2.svg")
plt.close(fig)
1,200 changes: 601 additions & 599 deletions docs/examples/S2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/examples/S2_autocorrelation.h5
Binary file not shown.
36 changes: 16 additions & 20 deletions docs/examples/S2_autocorrelation.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
r"""
Plot and/or check.
Usage:
script [options]
Options:
-s, --save Save output for later check.
-c, --check Check against earlier results.
-p, --plot Plot.
-h, --help Show this help.
"""
# <snippet>
import GooseEYE
import numpy as np
Expand Down Expand Up @@ -43,29 +31,36 @@
# </snippet>

if __name__ == "__main__":
import docopt
import argparse
import pathlib

args = docopt.docopt(__doc__)
root = pathlib.Path(__file__).parent

if args["--save"]:
parser = argparse.ArgumentParser()
parser.add_argument("--save", action="store_true")
parser.add_argument("--check", action="store_true")
parser.add_argument("--plot", action="store_true")
args = parser.parse_args()

if args.save:
import h5py

with h5py.File("S2_autocorrelation.h5", "w") as data:
with h5py.File(root / "S2_autocorrelation.h5", "w") as data:
data["I"] = img
data["S2"] = S2
data["Igr"] = Igr
data["S2gr"] = S2gr

if args["--check"]:
if args.check:
import h5py

with h5py.File("S2_autocorrelation.h5", "r") as data:
with h5py.File(root / "S2_autocorrelation.h5", "r") as data:
assert np.all(np.equal(data["I"][...], img))
assert np.allclose(data["S2"][...], S2)
assert np.allclose(data["Igr"][...], Igr)
assert np.allclose(data["S2gr"][...], S2gr)

if args["--plot"]:
if args.plot:
import matplotlib.pyplot as plt
import matplotlib as mpl
import matplotlib.cm as cm
Expand Down Expand Up @@ -158,4 +153,5 @@
ax.set_xlabel(r"$\Delta x$")
ax.set_ylabel(r"$S_2$")

plt.savefig("S2_autocorrelation.svg")
fig.savefig(root / "S2_autocorrelation.svg")
plt.close(fig)
2,638 changes: 1,324 additions & 1,314 deletions docs/examples/S2_autocorrelation.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/examples/S2_ensemble.h5
Binary file not shown.
36 changes: 16 additions & 20 deletions docs/examples/S2_ensemble.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
r"""
Plot and/or check.
Usage:
script [options]
Options:
-s, --save Save output for later check.
-c, --check Check against earlier results.
-p, --plot Plot.
-h, --help Show this help.
"""
# <snippet>
import GooseEYE
import numpy as np
Expand All @@ -24,23 +12,30 @@
# </snippet>

if __name__ == "__main__":
import docopt
import argparse
import pathlib

root = pathlib.Path(__file__).parent

args = docopt.docopt(__doc__)
parser = argparse.ArgumentParser()
parser.add_argument("--save", action="store_true")
parser.add_argument("--check", action="store_true")
parser.add_argument("--plot", action="store_true")
args = parser.parse_args()

if args["--save"]:
if args.save:
import h5py

with h5py.File("S2_ensemble.h5", "w") as data:
with h5py.File(root / "S2_ensemble.h5", "w") as data:
data["S2"] = S2

if args["--check"]:
if args.check:
import h5py

with h5py.File("S2_ensemble.h5", "r") as data:
with h5py.File(root / "S2_ensemble.h5", "r") as data:
assert np.allclose(data["S2"][...], S2)

if args["--plot"]:
if args.plot:
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable

Expand All @@ -64,4 +59,5 @@
cbar.set_ticks([0, phi])
cbar.set_ticklabels(["0", r"$\varphi$"])

plt.savefig("S2_ensemble.svg")
fig.savefig(root / "S2_ensemble.svg")
plt.close(fig)
Loading

0 comments on commit 7446da8

Please sign in to comment.