diff --git a/hugo/content/py/_index.md b/hugo/content/py/_index.md index 535ccb3d15c4ad3c9e67b003c68c1ec907cd75c6..66f88b59d8c60668bc3c8fdaa178ef56b8e28d70 100644 --- a/hugo/content/py/_index.md +++ b/hugo/content/py/_index.md @@ -22,10 +22,6 @@ one can * extend the functionality of the BornAgain core, for instance by adding particle form factors or correlation functions. -{{< figscg src="nodes_pycharm_ide.png" width="500" class="center" - caption="A BornAgain script running in the PyCharm IDE.">}} - - ## Installing the Python package The installer for any supported platform includes, among others, a Python package ('wheel'); for instance, for Python 3.9, the package can be found under `python/3.9/wheel` folder. diff --git a/hugo/content/py/nodes_pycharm_ide.png b/hugo/content/py/nodes_pycharm_ide.png deleted file mode 100644 index c449a44f1d917bed6220be6fdb14ad6c9c0d79e1..0000000000000000000000000000000000000000 Binary files a/hugo/content/py/nodes_pycharm_ide.png and /dev/null differ diff --git a/hugo/content/py/start/modify-script.md b/hugo/content/py/start/modify-script.md deleted file mode 100644 index cf9673305ee0f61835fe14b2b19c3cdf260f7c10..0000000000000000000000000000000000000000 --- a/hugo/content/py/start/modify-script.md +++ /dev/null @@ -1,59 +0,0 @@ -+++ -title = "Modify the script" -weight = 40 -+++ - -## Expanded simulation script - -As a first step towards writing sample and simulation specifications -of your own, let us expand the simulation script -[AlternatingLayers1.py]({{% ref-src "Examples/specular/AlternatingLayers1.py" %}}) -from the preceding pages. -Instead of the shorthand calls to modules -[std_samples]({{% ref-src "Wrap/Python/std_samples.py" %}}) and -[std_simulations]({{% ref-src "Wrap/Python/std_simulations.py" %}}), -we provide explicit code for the functions `get_sample` and `get_simulation`: -{{< highlightfile file="Examples/specular/AlternatingLayers1.py">}} -<p> - -### Sample - -`get_sample` is a function without arguments. -It returns an object of type [MultiLayer]({{% ref-api "classMultiLayer" %}}). - -The return statement is preceded by three stances. -Each stance starts with a comment line, -{{< highlight python >}} - # comment extends from hash character to end of line -{{< /highlight >}} - -BornAgain functions that start with a capital letter, -like `MaterialBySLD` or `Layer` are _constructors_ or -constructor-like global functions. -They return new _objects_. An object is an instance of a _class_. -The function `MaterialBySLD` instantiates an object of type -[Material]({{% ref-api "classMaterial" %}}) -the function `Layer` an object of type -[Layer]({{% ref-api "classLayer" %}}). - -Function like `addLayer` is a member function of class -[MultiLayer]({{% ref-api "classMultiLayer" %}}). -This can be seen from the two lines -{{< highlight python >}} - sample = ba.MultiLayer() - sample.addLayer(ambient_layer) -{{< /highlight >}} -where `sample` is created as a new instance of class `MultiLayer`. - -### Simulation - -`get_simulation(sample, scan_size=500)` is a function with one -required argument (`sample`) and one optional keyword argument -(`scan_size`). If the function is called with only one argument, -then `scan_size` is assigned the default value 500. - -`angstrom` and `deg` are numeric constants. They are used to -convert physical quantities to internal units nanometer and radian. - -The function returns an object of type -[SpecularSimulation]({{% ref-api "classSpecularSimulation" %}}).