diff --git a/docs/conf.py b/docs/conf.py index 96212302..15a1f7a1 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -3,11 +3,13 @@ author = "Tom de Geus" extensions = [ + "sphinx_tabs.tabs", + "sphinx.ext.autosummary", "sphinx.ext.mathjax", "sphinx.ext.todo", - "sphinx_tabs.tabs", ] +autodoc_type_aliases = {"Iterable": "Iterable", "ArrayLike": "ArrayLike", "DTypeLike": "DTypeLike"} templates_path = ["_templates"] exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] html_theme = "furo" diff --git a/docs/examples/structure-dark.svg b/docs/examples/structure-dark.svg new file mode 100644 index 00000000..d04eada0 --- /dev/null +++ b/docs/examples/structure-dark.svg @@ -0,0 +1,3242 @@ + + + + + + + + 2023-12-10T12:18:36.783843 + image/svg+xml + + + Matplotlib v3.8.2, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/examples/structure.py b/docs/examples/structure.py index 2f5957bf..00f1a156 100644 --- a/docs/examples/structure.py +++ b/docs/examples/structure.py @@ -22,6 +22,8 @@ parser.add_argument("--save", action="store_true") parser.add_argument("--check", action="store_true") parser.add_argument("--plot", action="store_true") + parser.add_argument("--dark", action="store_true", help="use dark theme to plot") + parser.add_argument("--show", action="store_true", help="show plot instead of saving it") args = parser.parse_args() if args.save: @@ -42,7 +44,10 @@ import matplotlib.pyplot as plt try: - plt.style.use(["goose", "goose-latex"]) + styles = ["goose", "goose-latex"] + if args.dark: + styles += ["dark_background"] + plt.style.use(styles) except OSError: pass @@ -51,17 +56,26 @@ ax.set_xscale("log") ax.set_yscale("log") - ax.set_xlabel(r"$|q|$") + ax.set_xlabel(r"$2 \sin(|q| / 2)$") ax.set_ylabel(r"$S(|q|)$") q = structure.qnorm s = structure.mean()[1 : q.size] q = q[1:] + q *= 2 * np.pi + q = 2 * np.sin(q * 0.5) scaling = 1 / (q**2) scaling *= s[1] / scaling[1] ax.plot(q, s, marker=".") ax.plot(q, scaling, ls="--") - fig.savefig(root / "structure.svg") + if args.show: + plt.show() + else: + if args.dark: + plt.savefig(root / "structure-dark.svg") + else: + fig.savefig(root / "structure.svg") + plt.close(fig) diff --git a/docs/examples/structure.svg b/docs/examples/structure.svg index df527717..b5d81ab4 100644 --- a/docs/examples/structure.svg +++ b/docs/examples/structure.svg @@ -6,7 +6,7 @@ - 2023-11-23T16:12:50.927457 + 2023-12-10T12:18:39.734411 image/svg+xml @@ -43,27 +43,27 @@ z - - + - - + - - + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - + - + - - + + - - + - - + - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - + + + + + + + + - - - + + + + + + + + + + + - + - - + - + - - + - + @@ -647,19 +690,19 @@ L 3.5 0 - + - + - + - + - + @@ -667,19 +710,19 @@ L 3.5 0 - + - + - + - + - + @@ -687,19 +730,19 @@ L 3.5 0 - + - + - + - + - + @@ -707,19 +750,49 @@ L 3.5 0 - + - + - + - + - + + + + @@ -727,19 +800,19 @@ L 3.5 0 - + - + - + - + - + - + - - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -1482,32 +1519,6 @@ C 3558 2903 3610 2903 3629 2903 C 3686 2903 3693 2922 3718 3024 L 4064 4422 z -" transform="scale(0.015625)"/> - - @@ -1519,776 +1530,670 @@ z - + +L 135.853518 101.706824 +L 161.335928 121.2935 +L 179.415896 134.104824 +L 204.897918 153.970831 +L 214.585594 160.524569 +L 222.977344 167.142222 +L 230.379295 173.715138 +L 237.000468 177.44097 +L 242.98995 182.617444 +L 248.457819 186.324382 +L 253.487672 189.502799 +L 258.144489 192.914279 +L 262.479782 195.560437 +L 266.535079 199.975483 +L 270.344344 202.107356 +L 273.935714 203.885021 +L 280.555417 209.923847 +L 286.543273 213.564176 +L 289.335802 215.842149 +L 292.009362 217.367293 +L 294.573666 219.756661 +L 297.037281 220.342249 +L 299.407805 222.785035 +L 301.692008 225.772946 +L 303.895945 226.956718 +L 306.025057 228.450888 +L 308.084247 229.387792 +L 310.077954 231.609115 +L 312.010204 233.089192 +L 313.884665 233.408028 +L 315.704684 235.706034 +L 317.473326 236.558905 +L 319.193405 237.159458 +L 320.867507 239.128733 +L 322.498019 240.297607 +L 325.63693 241.853484 +L 327.149263 243.725573 +L 330.0685 245.424682 +L 331.478571 247.137941 +L 332.857546 248.365346 +L 334.206761 248.438178 +L 335.527467 249.523299 +L 336.820839 249.703307 +L 338.087977 251.665549 +L 339.32992 252.842069 +L 340.547644 252.909066 +L 342.914065 255.490743 +L 344.064452 255.361641 +L 345.194009 256.672951 +L 346.30347 256.750274 +L 348.464859 259.098728 +L 349.518076 259.472075 +L 350.553781 260.895589 +L 351.572542 261.350651 +L 352.5749 262.013635 +L 353.56137 263.146703 +L 354.532442 263.323334 +L 355.488586 264.029603 +L 356.430249 263.967605 +L 357.357857 265.730097 +L 358.271822 266.407533 +L 359.172532 266.907969 +L 360.935675 268.812851 +L 361.79881 268.93556 +L 362.650098 269.691478 +L 363.489857 269.243862 +L 364.31839 269.357104 +L 365.13599 271.03601 +L 365.942937 272.273792 +L 366.739501 272.776096 +L 367.525943 272.489803 +L 369.06945 274.605744 +L 369.826989 274.482793 +L 370.575352 275.40664 +L 371.314756 275.61168 +L 372.045409 276.306026 +L 372.767512 277.363447 +L 373.481259 276.814069 +L 374.186839 277.074524 +L 374.884432 278.744283 +L 375.574213 278.959931 +L 376.256353 279.349511 +L 376.931016 278.993961 +L 377.598359 280.145275 +L 378.258538 282.255042 +L 378.911701 281.01646 +L 380.197552 282.282217 +L 380.830515 282.609387 +L 381.457014 282.32803 +L 382.691125 284.409112 +L 383.298981 284.234773 +L 383.900861 284.225902 +L 384.496878 285.274181 +L 385.087143 285.73195 +L 386.25084 287.626511 +L 386.824477 288.174334 +L 387.955822 286.789127 +L 388.513718 288.290167 +L 389.614412 289.124599 +L 390.157384 290.057187 +L 390.695552 289.903358 +L 391.228997 290.481716 +L 392.282035 290.48208 +L 393.31711 291.200844 +L 393.828094 292.840039 +L 394.334805 292.765645 +L 394.837308 292.967296 +L 395.335673 292.948703 +L 395.829963 293.509645 +L 396.320242 294.492438 +L 396.806572 294.309007 +L 397.289015 294.367623 +L 398.242471 295.336433 +L 399.181069 296.067208 +L 399.644933 296.902549 +L 400.105245 297.069548 +L 400.562056 297.700496 +L 401.015418 297.318734 +L 401.465378 298.062899 +L 401.911987 298.048789 +L 402.795335 299.115955 +L 403.232166 298.858011 +L 403.665828 298.859476 +L 404.948231 301.891542 +L 405.369643 300.567821 +L 405.788094 300.438315 +L 406.203624 300.769746 +L 406.616271 300.551202 +L 407.026072 301.706809 +L 407.433064 301.619405 +L 407.837285 302.771422 +L 408.238768 302.344267 +L 408.637549 302.500852 +L 409.033661 304.448543 +L 409.427139 303.982133 +L 410.206321 303.787788 +L 410.592089 304.484342 +L 410.97535 303.962282 +L 412.110389 306.938911 +L 412.855088 305.983239 +L 413.590455 307.324501 +L 413.954706 307.04694 +L 414.316704 307.400996 +L 414.676475 306.635382 +L 415.389438 307.973176 +L 415.742678 307.94645 +L 416.789725 309.578491 +L 417.134593 309.460116 +L 418.493923 310.254179 +L 418.828829 310.083141 +L 419.161805 310.218265 +L 419.492872 311.748039 +L 419.82205 311.193429 +L 420.474819 312.142909 +L 421.120265 311.652556 +L 421.758536 312.39056 +L 422.075027 313.522177 +L 422.389778 312.219803 +L 422.702807 312.640289 +L 423.323764 314.241327 +L 423.938033 314.547626 +L 424.2427 315.284349 +L 424.545744 315.211096 +L 424.847179 314.027262 +L 425.147021 315.07187 +L 425.445285 314.812524 +L 425.741987 315.057326 +L 426.03714 315.815724 +L 426.33076 315.539509 +L 426.913455 316.40196 +L 427.202558 315.81957 +L 427.490184 317.094636 +L 427.776345 316.416857 +L 428.061055 317.37054 +L 428.626173 318.398059 +L 428.906608 317.67068 +L 429.185642 318.209566 +L 429.739561 317.475335 +L 430.01447 319.005096 +L 430.288027 319.576134 +L 430.560244 318.448229 +L 430.831134 318.489661 +L 431.100707 319.715413 +L 431.368974 318.895147 +L 431.901637 321.140974 +L 432.166054 320.631448 +L 432.429209 320.533426 +L 432.691112 320.688422 +L 432.951775 320.616805 +L 433.211207 321.656508 +L 433.469418 321.626217 +L 433.726419 321.314491 +L 433.982218 321.79287 +L 434.236827 321.793185 +L 434.490254 321.382193 +L 434.74251 321.675575 +L 435.243542 323.090234 +L 435.492337 322.412497 +L 435.986531 323.891712 +L 436.231947 323.371336 +L 436.476254 323.355474 +L 436.961577 323.117329 +L 437.20261 323.298665 +L 437.442567 324.709942 +L 437.681457 324.406371 +L 437.919289 324.603921 +L 438.15607 324.51201 +L 438.391808 325.23495 +L 438.62651 324.372922 +L 439.092841 324.419576 +L 440.013415 326.306594 +L 440.241082 325.576757 +L 440.467774 325.75989 +L 440.693497 326.115358 +L 440.918257 326.811419 +L 441.142063 327.057841 +L 441.586836 326.795627 +L 441.807816 326.804408 +L 442.027868 327.409619 +L 442.246998 328.481364 +L 442.465212 327.543257 +L 442.682517 327.811288 +L 442.89892 328.300093 +L 443.329039 327.995868 +L 443.755621 329.290291 +L 443.967599 328.218908 +L 444.178711 329.555858 +L 444.598358 329.332662 +L 444.806904 329.796196 +L 445.014606 329.98227 +L 445.221469 329.385513 +L 445.4275 329.874275 +L 445.837084 329.606202 +L 446.040648 330.193957 +L 446.445348 332.018694 +L 446.646493 331.142921 +L 446.846843 331.642105 +L 447.046402 331.174567 +L 447.245174 331.048941 +L 447.443166 329.916073 +L 447.640382 330.345428 +L 447.836826 332.037786 +L 448.032504 331.740292 +L 448.227421 332.177829 +L 448.42158 331.334798 +L 448.807647 333.103867 +L 448.999563 332.826946 +L 449.190741 333.495949 +L 449.381185 331.979754 +L 449.570899 332.357501 +L 449.759888 333.597364 +L 449.948156 333.328879 +L 450.135708 333.636206 +L 450.322547 332.54684 +L 450.508678 332.701042 +L 450.878832 334.332116 +L 451.062864 333.982252 +L 451.246204 334.140855 +L 451.428856 333.692064 +L 451.610825 334.380607 +L 451.792114 335.615487 +L 451.972728 334.493357 +L 452.152669 335.063099 +L 452.331942 334.689166 +L 452.510552 335.257599 +L 452.6885 335.31726 +L 452.865792 335.850541 +L 453.042431 335.526165 +L 453.218421 336.004098 +L 453.393764 334.956896 +L 453.742529 336.553235 +L 453.915957 336.559494 +L 454.088753 336.286715 +L 454.260921 337.130235 +L 454.432465 337.053584 +L 454.603387 337.555565 +L 454.773691 336.782233 +L 454.943381 337.173673 +L 455.112459 336.796078 +L 455.280929 336.931985 +L 455.448795 337.492977 +L 455.616059 336.858192 +L 455.782725 337.151383 +L 456.114274 336.978962 +L 456.279164 338.464267 +L 456.607189 338.378809 +L 456.77033 339.050222 +L 456.932894 338.957321 +L 457.094885 339.080014 +L 457.577444 337.869796 +L 457.737169 338.352544 +L 458.054944 340.158572 +L 458.370504 338.579136 +L 458.527461 338.570679 +L 458.683872 339.418135 +L 458.83974 338.639361 +L 458.995069 339.585856 +L 459.14986 339.297005 +L 459.304116 339.352836 +L 459.457841 339.103588 +L 459.611036 340.345864 +L 459.763704 339.958363 +L 459.915848 341.510812 +L 460.067469 340.777436 +L 460.218572 342.114858 +L 460.369158 342.102266 +L 460.519229 340.686257 +L 460.668789 341.241857 +L 460.817839 340.731568 +L 460.966382 340.715966 +L 461.11442 341.169656 +L 461.261956 341.005405 +L 461.408993 341.284089 +L 461.555531 341.031027 +L 461.701574 342.100962 +L 461.847125 342.01544 +L 461.992184 341.615212 +L 462.136755 341.713114 +L 462.424441 341.268598 +L 462.7102 343.157499 +L 462.852362 343.316825 +L 463.135263 342.742683 +L 463.276006 343.571424 +L 463.41628 343.283312 +L 463.556087 343.369599 +L 463.695429 343.201722 +L 463.834309 344.176065 +L 463.972728 343.099189 +L 464.385241 344.033987 +L 464.657984 343.593897 +L 464.793681 343.713735 +L 464.928932 343.05633 +L 465.063737 344.171395 +L 465.1981 343.464987 +L 465.332021 344.525859 +L 465.598549 344.051853 +L 465.731158 344.864695 +L 465.863334 344.228055 +L 465.995078 344.580987 +L 466.126392 344.379021 +L 466.387737 345.308274 +L 466.517772 345.454338 +L 466.647383 345.278439 +L 466.776574 345.764287 +L 467.033698 345.16355 +L 467.416268 347.03609 +L 467.542967 346.822482 +L 467.669257 346.198829 +L 467.795139 346.437453 +L 467.920615 346.943832 +L 468.045687 346.007916 +L 468.418491 347.844736 +L 468.54196 347.591097 +L 468.665033 346.910431 +L 468.909996 347.825684 +L 469.031889 347.667739 +L 469.153391 348.024932 +L 469.39523 347.482169 +L 469.51557 348.343993 +L 469.635526 347.261754 +L 469.755098 347.543946 +L 469.87429 348.262373 +L 469.9931 347.769846 +L 470.229588 348.071818 +L 470.347267 349.144394 +L 470.464572 349.125732 +L 470.581504 347.845418 +L 470.814254 349.069703 +L 470.930075 349.72045 +L 471.160616 347.776009 +L 471.503694 348.985928 +L 471.61733 348.686573 +L 471.843525 349.461703 +L 471.956086 349.071172 +L 472.068291 349.783795 +L 472.180142 348.49641 +L 472.29164 349.663311 +L 472.402786 349.195881 +L 472.513581 349.340014 +L 472.624026 349.745071 +L 472.734124 349.410141 +L 472.843874 349.941741 +L 472.953279 349.22398 +L 473.062338 350.352109 +L 473.171055 349.239069 +L 473.495156 351.319838 +L 473.709527 350.335749 +L 473.922553 350.86732 +L 474.134243 350.745065 +L 474.239589 350.937001 +L 474.344604 350.68148 +L 474.553648 351.79978 +L 474.761381 351.103943 +L 475.172951 351.633691 +L 475.680197 352.867037 +L 475.880876 351.63974 +L 476.179543 353.574027 +L 476.278475 351.829014 +L 476.573416 353.14093 +L 476.671114 353.621875 +L 476.962375 352.607308 +L 477.058854 353.73236 +L 477.250906 352.572595 +L 477.346481 352.711743 +L 477.441756 352.163461 +L 477.631411 353.502673 +L 477.725792 353.799384 +L 477.819877 354.56834 +L 477.913668 354.161978 +L 478.007164 353.21169 +L 478.100366 353.642341 +L 478.193276 354.948748 +L 478.562008 353.624024 +L 478.653468 353.737551 +L 478.744641 354.306104 +L 478.835527 353.890656 +L 479.016443 354.996901 +L 479.196222 354.672407 +L 479.374871 354.820634 +L 479.463773 355.820308 +L 479.552396 355.514421 +L 479.640739 355.978781 +L 479.728804 354.017684 +L 479.816591 355.441604 +L 479.991335 354.801834 +L 480.164977 355.63922 +L 480.251386 354.95378 +L 480.337523 354.997073 +L 480.5943 356.41118 +L 480.764133 355.900731 +L 480.848646 356.341228 +L 480.932891 356.214655 +L 481.016868 356.11924 +L 481.100579 356.626854 +L 481.184024 356.402527 +L 481.267203 357.558324 +L 481.43277 357.012424 +L 481.515158 357.14466 +L 481.597284 356.336966 +L 481.679149 357.172447 +L 481.760752 355.737298 +L 481.842094 357.08954 +L 481.923177 356.387331 +L 482.244926 357.685863 +L 482.404259 356.58251 +L 482.562572 356.778789 +L 482.641347 357.433394 +L 482.798139 356.371798 +L 482.876156 356.259429 +L 483.031439 357.611095 +L 483.108704 356.775377 +L 483.18572 357.77153 +L 483.262488 357.260504 +L 483.415278 357.879669 +L 483.491303 357.370285 +L 483.642613 358.016927 +L 483.7179 357.808468 +L 483.792942 359.13039 +L 483.867741 357.922831 +L 484.016607 359.300362 +L 484.090677 358.835019 +L 484.164505 359.404011 +L 484.311437 358.065843 +L 484.384543 358.437757 +L 484.530036 357.879633 +L 484.74649 358.60592 +L 484.818167 358.547151 +L 484.889608 358.113526 +L 485.173019 360.06418 +L 485.383123 358.107115 +L 485.591138 359.333097 +L 485.660015 359.375376 +L 485.728662 358.918141 +L 485.797079 359.484454 +L 485.865268 359.072886 +L 486.000959 360.589833 +L 486.068464 360.453252 +L 486.135741 359.742734 +L 486.336216 360.823058 +L 486.40259 359.268678 +L 486.468739 359.890348 +L 486.534665 359.684928 +L 486.600366 359.942929 +L 486.665845 359.277171 +L 486.7311 360.938887 +L 486.796134 360.093416 +L 486.860945 359.738487 +L 487.054053 360.92654 +L 487.117982 360.147038 +L 487.181691 360.688404 +L 487.371506 359.709303 +L 487.434341 359.840907 +L 487.496959 361.099903 +L 487.559361 360.383389 +L 487.621545 360.41968 +L 487.683514 359.795326 +L 487.868127 361.303352 +L 487.929235 360.4737 +L 487.99013 361.131886 +L 488.111278 361.595441 +L 488.231576 360.94545 +L 488.291407 361.824256 +L 488.351026 361.197623 +L 488.410434 361.228424 +L 488.469632 361.97016 +L 488.528619 361.42897 +L 488.645964 361.63927 +L 488.704322 360.67806 +L 488.878147 361.938935 +L 488.935672 361.679291 +L 488.992991 361.700249 +L 489.163707 362.098957 +L 489.2202 361.976345 +L 489.38845 362.888217 +L 489.554861 361.460314 +L 489.719444 363.235014 +L 489.7739 361.833356 +L 489.828154 363.106543 +L 489.936059 361.945182 +L 490.096411 364.09705 +L 490.254966 362.240862 +L 490.30742 362.759473 +L 490.359676 362.157327 +L 490.411733 363.240119 +L 490.463593 362.040553 +L 490.515255 362.210092 +L 490.56672 363.245866 +L 490.617989 362.943375 +L 490.719937 361.803318 +L 490.770617 362.505281 +L 490.871392 363.801758 +L 491.070604 362.429781 +L 491.169048 363.828425 +L 491.21798 362.853462 +L 491.315266 363.028243 +L 491.363621 363.160774 +L 491.411784 362.826144 +L 491.459756 363.06737 +L 491.555126 363.715311 +L 491.602524 363.437195 +L 491.649733 363.060422 +L 491.790218 364.888817 +L 491.836668 363.056395 +L 491.882929 363.797813 +L 492.02058 364.580657 +L 492.066088 364.706644 +L 492.111408 364.540909 +L 492.156541 363.869395 +L 492.246246 364.093673 +L 492.290818 364.204536 +L 492.335205 364.111797 +L 492.467249 365.575754 +L 492.597626 363.898766 +L 492.726343 365.21862 +L 492.768881 364.666701 +L 492.811236 364.827829 +L 492.853407 365.579212 +L 492.895396 365.432273 +L 492.937202 364.990922 +L 492.978825 366.139983 +L 493.020267 364.64577 +L 493.143499 365.103848 +L 493.184214 365.051062 +L 493.224748 364.646314 +L 493.265101 365.20575 +L 493.305273 364.879506 +L 493.424709 364.134231 +L 493.581444 365.289263 +L 493.62018 364.872495 +L 493.658738 365.352699 +L 493.697117 365.649882 +L 493.773342 365.938217 +L 493.848856 364.638544 +L 493.997758 365.663932 +L 494.034543 365.237331 +L 494.071151 365.59703 +L 494.17992 366.125327 +L 494.215825 365.831014 +L 494.322491 365.102872 +L 494.28711 366.04967 +L 494.357696 365.485384 +L 494.462268 366.117234 +L 494.496778 366.047138 +L 494.565276 366.103922 +L 494.633081 365.039732 +L 494.666725 366.534477 +L 494.733493 366.053995 +L 494.766619 365.088617 +L 494.799573 366.446722 +L 494.832354 366.18493 +L 494.864964 366.124201 +L 494.929669 365.037144 +L 494.961765 365.812582 +L 494.99369 366.354131 +L 495.057026 366.078766 +L 495.088439 365.599009 +L 495.119681 366.727206 +L 495.150753 366.144092 +L 495.242949 366.040898 +L 495.303565 366.814488 +L 495.363504 365.802397 +L 495.452146 366.324538 +L 495.481357 366.223346 +L 495.510399 365.228165 +L 495.539273 366.919229 +L 495.567979 367.771028 +L 495.624888 366.731088 +L 495.653092 367.217811 +L 495.681127 366.075249 +L 495.764232 366.43361 +L 495.7916 366.310652 +L 495.872705 367.066732 +L 495.925944 366.820849 +L 495.978519 367.020198 +L 496.030432 366.374074 +L 496.05614 367.753465 +L 496.107061 366.216027 +L 496.132274 367.665 +L 496.206925 366.693112 +L 496.23148 367.296066 +L 496.25587 367.395336 +L 496.280096 366.841038 +L 496.304158 367.230589 +L 496.328057 368.334329 +L 496.351791 367.017944 +L 496.375362 367.078675 +L 496.398769 366.32828 +L 496.468011 367.641717 +L 496.602094 366.652717 +L 496.666943 367.812927 +L 496.730333 367.51206 +L 496.771784 366.820805 +L 496.792268 367.138118 +L 496.872589 368.212159 +L 496.832751 367.076391 +L 496.911783 367.988946 +L 496.988243 366.83101 +L 497.062137 367.469971 +L 497.185294 368.744334 +L 497.20225 368.435676 +L 497.363059 366.279822 +L 497.408208 369.318198 +L 497.480293 369.106239 +L 497.535117 367.295208 +L 497.600103 368.009795 +L 497.612628 368.458783 +L 497.672895 367.234902 +L 497.684478 367.334504 +L 497.781668 369.128566 +L 497.86619 368.862202 +L 497.899699 367.694596 +L 497.930715 369.36 +L 497.979002 367.782748 +L 498.056845 369.307223 +L 498.00883 366.778571 +L 498.089357 367.811155 +L 498.10793 367.357206 +L 498.099805 369.307188 +L 498.109091 369.069673 +" clip-path="url(#p6b34ba5f49)" style="fill: none; stroke: #000000; stroke-width: 2; stroke-linecap: square"/> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + diff --git a/docs/python_install.rst b/docs/python_install.rst index 1386a8f8..6bcfa7e0 100644 --- a/docs/python_install.rst +++ b/docs/python_install.rst @@ -11,37 +11,30 @@ The quickest (but not the most efficient!) is to use *conda* to install *GooseEY .. warning:: - This package does not benefit from *xsimd* optimisation, as it is not compiled on your hardware. Therefore compiling by hand is recommended. + This package does not benefit from *xsimd* optimisation, as it is not compiled on your hardware. Therefore compiling by hand can be advantageous. From source ^^^^^^^^^^^ -Start by installing the dependencies, for example using *conda*:: +Start by downloading the package:: - conda install -c conda-forge pyxtensor xsimd - -Note that *xsimd* is optional, but recommended. - -.. note:: - - You can also use:: + git checkout https://github.com/tdegeus/GooseEYE.git + cd GooseEYE - python -m pip install pyxtensor pybind11 +Then, install the dependencies, for example using *conda*:: - for use without *conda*. Note that you install *xsimd* yourself in such a way that Python can find it in order to use it. + conda env update --file environment.yaml -Then, download the package:: +Finally, install the package using:: - git checkout https://github.com/tdegeus/GooseEYE.git - cd GooseEYE + python -m pip install . -v --no-build-isolation --no-deps -Install the package using:: +If you want to use hardware optimisations, you can use:: - python -m pip install . + SKBUILD_CONFIGURE_OPTIONS="-DUSE_SIMD=1" python -m pip install . -v --no-build-isolation --no-deps .. note:: - The following will give more readable output:: - - python setup.py build - python setup.py install + Since you are compiling a C++ extension, with C++ libraries as dependencies, you cannot rely solely on *pip* to install the dependencies. + As observed, *conda* does contain all the dependencies. + Alternatively, you can use whatever non-supported method you prefer. diff --git a/docs/python_usage.rst b/docs/python_usage.rst index 85de71d8..76752f63 100644 --- a/docs/python_usage.rst +++ b/docs/python_usage.rst @@ -2,9 +2,11 @@ Functions & Usage ################### -The Python interface is a simple wrapper around the C++ classes and -functions. In general the Python and C++ codes are almost identical, -with as only differences: +Syntax +====== + +The Python interface is mostly wrapper around the C++ classes and functions. +In general the Python and C++ codes are almost identical, with as only differences: - The C++ ``xt::xarray`` are ``numpy.ndarray`` in Python. - The syntax ``::`` in Python in simply a ``.``. @@ -20,3 +22,19 @@ In Python is .. code:: python ensemble = GooseEYE.Ensemble([51, 51]) + +Python only functions +===================== + +Overview +-------- + +.. autosummary:: + + GooseEYE.Structure + +Details +------- + +.. automodule:: GooseEYE + :members: diff --git a/docs/theory_heightheight.rst b/docs/theory_heightheight.rst index ee7e3dc9..071da689 100644 --- a/docs/theory_heightheight.rst +++ b/docs/theory_heightheight.rst @@ -1,5 +1,36 @@ .. _theory_heightheight: +****************** +Height correlation +****************** + +Structure factor +================ + +The structure factor is defined as: + +.. math:: + + S(\vec{q}) = \langle \hat{u}(\vec{q}) \hat{u}(\vec{q}) \rangle + +where :math:`\vec{q}` is the angular frequency. +It can be used to compute the roughness exponent :math:`\zeta`: + +.. math:: + + S(|q|) \sim |q|^{-(d + 2 \zeta)} + +where :math:`d` is the dimension of the image. +An example is shown below. + +.. image:: examples/structure.svg + :width: 700px + :class: only-light + +.. image:: examples/structure-dark.svg + :width: 700px + :class: only-dark + Height-height correlation ========================= diff --git a/python/GooseEYE/__init__.py b/python/GooseEYE/__init__.py index 36f2e23c..25c93dd0 100644 --- a/python/GooseEYE/__init__.py +++ b/python/GooseEYE/__init__.py @@ -11,6 +11,7 @@ def ClusterLabeller(shape, periodic=True, **kwargs): """ Allocate a cluster labeller. + :param shape: The shape of the image. :param periodic: Whether the image is periodic. :return: A cluster labeller.