Skip to content
Snippets Groups Projects
Commit 6108c378 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

autoformat Python sources

PYTHONPATH=/usr/lib/python3/dist-packages python3 /usr/lib/python3/dist-packages/yapf -i

applied to Examples/*/*py and Wrap/*/*py
parent d8f88f11
No related branches found
No related tags found
1 merge request!1238Change Beam API, don't expose Direction
Showing
with 40 additions and 41 deletions
......@@ -449,7 +449,6 @@ def simulate(sample,
if qmax:
qzs = np.linspace(0., qmax[0]/angstrom, scan_size)
n_sig = 4.0
n_samples = 25
distr = ba.RangedDistributionGaussian(n_samples, n_sig)
......
......@@ -4,12 +4,12 @@ import bornagain as ba
from bornagain import ba_plot as bp, deg, nm, std_samples, std_simulations
material_particle = ba.RefractiveMaterial("Particle", 1e-6, 0)
ff = ba.Bipyramid4(8 * nm, 4.3 * nm, 0.5, 70 * deg)
ff = ba.Bipyramid4(8*nm, 4.3*nm, 0.5, 70*deg)
def get_sample(omega):
particle = ba.Particle(material_particle, ff)
particle.rotate(ba.RotationZ(omega * deg))
particle.rotate(ba.RotationZ(omega*deg))
return std_samples.sas_sample_with_particle(particle)
......
......@@ -4,12 +4,12 @@ import bornagain as ba
from bornagain import ba_plot as bp, deg, nm, std_samples, std_simulations
material_particle = ba.RefractiveMaterial("Particle", 1e-6, 0)
ff = ba.Box(12 * nm, 4.1 * nm, 6 * nm)
ff = ba.Box(12*nm, 4.1*nm, 6*nm)
def get_sample(omega):
particle = ba.Particle(material_particle, ff)
particle.rotate(ba.RotationZ(omega * deg))
particle.rotate(ba.RotationZ(omega*deg))
return std_samples.sas_sample_with_particle(particle)
......
......@@ -4,12 +4,12 @@ import bornagain as ba
from bornagain import ba_plot as bp, deg, nm, std_samples, std_simulations
material_particle = ba.RefractiveMaterial("Particle", 1e-6, 0)
ff = ba.CantellatedCube(8 * nm, 2.5 * nm)
ff = ba.CantellatedCube(8*nm, 2.5*nm)
def get_sample(omega):
particle = ba.Particle(material_particle, ff)
particle.rotate(ba.RotationZ(omega * deg))
particle.rotate(ba.RotationZ(omega*deg))
return std_samples.sas_sample_with_particle(particle)
......
......@@ -4,12 +4,12 @@ import bornagain as ba
from bornagain import ba_plot as bp, deg, nm, std_samples, std_simulations
material_particle = ba.RefractiveMaterial("Particle", 1e-6, 0)
ff = ba.Cone(4.25 * nm, 12 * nm, 75 * deg)
ff = ba.Cone(4.25*nm, 12*nm, 75*deg)
def get_sample(omega):
particle = ba.Particle(material_particle, ff)
particle.rotate(ba.RotationY(omega * deg))
particle.rotate(ba.RotationY(omega*deg))
return std_samples.sas_sample_with_particle(particle)
......
......@@ -4,12 +4,12 @@ import bornagain as ba
from bornagain import ba_plot as bp, deg, nm, std_samples, std_simulations
material_particle = ba.RefractiveMaterial("Particle", 1e-6, 0)
ff = ba.Cylinder(3.6 * nm, 7.2 * nm)
ff = ba.Cylinder(3.6*nm, 7.2*nm)
def get_sample(omega):
particle = ba.Particle(material_particle, ff)
particle.rotate(ba.RotationY(omega * deg))
particle.rotate(ba.RotationY(omega*deg))
return std_samples.sas_sample_with_particle(particle)
......
......@@ -4,12 +4,12 @@ import bornagain as ba
from bornagain import ba_plot as bp, deg, nm, std_samples, std_simulations
material_particle = ba.RefractiveMaterial("Particle", 1e-6, 0)
ff = ba.Dodecahedron(3.38 * nm)
ff = ba.Dodecahedron(3.38*nm)
def get_sample(omega):
particle = ba.Particle(material_particle, ff)
particle.rotate(ba.RotationY(omega * deg))
particle.rotate(ba.RotationY(omega*deg))
return std_samples.sas_sample_with_particle(particle)
......
......@@ -4,12 +4,12 @@ import bornagain as ba
from bornagain import ba_plot as bp, deg, nm, std_samples, std_simulations
material_particle = ba.RefractiveMaterial("Particle", 1e-6, 0)
ff = ba.EllipsoidalCylinder(7.8 * nm, 3 * nm, 4 * nm)
ff = ba.EllipsoidalCylinder(7.8*nm, 3*nm, 4*nm)
def get_sample(omega):
particle = ba.Particle(material_particle, ff)
particle.rotate(ba.RotationZ(omega * deg))
particle.rotate(ba.RotationZ(omega*deg))
return std_samples.sas_sample_with_particle(particle)
......
......@@ -4,12 +4,12 @@ import bornagain as ba
from bornagain import ba_plot as bp, deg, nm, std_samples, std_simulations
material_particle = ba.RefractiveMaterial("Particle", 1e-6, 0)
ff = ba.HemiEllipsoid(4.4 * nm, 8 * nm, 4 * nm)
ff = ba.HemiEllipsoid(4.4*nm, 8*nm, 4*nm)
def get_sample(omega):
particle = ba.Particle(material_particle, ff)
particle.rotate(ba.RotationZ(omega * deg))
particle.rotate(ba.RotationZ(omega*deg))
return std_samples.sas_sample_with_particle(particle)
......
......@@ -4,12 +4,12 @@ import bornagain as ba
from bornagain import ba_plot as bp, deg, nm, std_samples, std_simulations
material_particle = ba.RefractiveMaterial("Particle", 1e-6, 0)
ff = ba.HorizontalCylinder(4 * nm, 9 * nm, -2 * nm, 2.3 * nm)
ff = ba.HorizontalCylinder(4*nm, 9*nm, -2*nm, 2.3*nm)
def get_sample(omega):
particle = ba.Particle(material_particle, ff)
particle.rotate(ba.RotationZ(omega * deg))
particle.rotate(ba.RotationZ(omega*deg))
return std_samples.sas_sample_with_particle(particle)
......
......@@ -4,12 +4,12 @@ import bornagain as ba
from bornagain import ba_plot as bp, deg, nm, std_samples, std_simulations
material_particle = ba.RefractiveMaterial("Particle", 1e-6, 0)
ff = ba.Icosahedron(5.13 * nm)
ff = ba.Icosahedron(5.13*nm)
def get_sample(omega):
particle = ba.Particle(material_particle, ff)
particle.rotate(ba.RotationY(omega * deg))
particle.rotate(ba.RotationY(omega*deg))
return std_samples.sas_sample_with_particle(particle)
......
......@@ -4,12 +4,12 @@ import bornagain as ba
from bornagain import ba_plot as bp, deg, nm, std_samples, std_simulations
material_particle = ba.RefractiveMaterial("Particle", 1e-6, 0)
ff = ba.PlatonicOctahedron(8.55 * nm)
ff = ba.PlatonicOctahedron(8.55*nm)
def get_sample(omega):
particle = ba.Particle(material_particle, ff)
particle.rotate(ba.RotationY(omega * deg))
particle.rotate(ba.RotationY(omega*deg))
return std_samples.sas_sample_with_particle(particle)
......
......@@ -4,12 +4,12 @@ import bornagain as ba
from bornagain import ba_plot as bp, deg, nm, std_samples, std_simulations
material_particle = ba.RefractiveMaterial("Particle", 1e-6, 0)
ff = ba.PlatonicTetrahedron(13.6 * nm)
ff = ba.PlatonicTetrahedron(13.6*nm)
def get_sample(omega):
particle = ba.Particle(material_particle, ff)
particle.rotate(ba.RotationY(omega * deg))
particle.rotate(ba.RotationY(omega*deg))
return std_samples.sas_sample_with_particle(particle)
......
......@@ -4,12 +4,12 @@ import bornagain as ba
from bornagain import ba_plot as bp, deg, nm, std_samples, std_simulations
material_particle = ba.RefractiveMaterial("Particle", 1e-6, 0)
ff = ba.Prism3(9.2 * nm, 8 * nm)
ff = ba.Prism3(9.2*nm, 8*nm)
def get_sample(omega):
particle = ba.Particle(material_particle, ff)
particle.rotate(ba.RotationZ(omega * deg))
particle.rotate(ba.RotationZ(omega*deg))
return std_samples.sas_sample_with_particle(particle)
......
......@@ -4,12 +4,12 @@ import bornagain as ba
from bornagain import ba_plot as bp, deg, nm, std_samples, std_simulations
material_particle = ba.RefractiveMaterial("Particle", 1e-6, 0)
ff = ba.Prism6(3.77 * nm, 8 * nm)
ff = ba.Prism6(3.77*nm, 8*nm)
def get_sample(omega):
particle = ba.Particle(material_particle, ff)
particle.rotate(ba.RotationZ(omega * deg))
particle.rotate(ba.RotationZ(omega*deg))
return std_samples.sas_sample_with_particle(particle)
......
......@@ -4,12 +4,12 @@ import bornagain as ba
from bornagain import ba_plot as bp, deg, nm, std_samples, std_simulations
material_particle = ba.RefractiveMaterial("Particle", 1e-6, 0)
ff = ba.Pyramid2(6.4 * nm, 13 * nm, 7 * nm, 70 * deg)
ff = ba.Pyramid2(6.4*nm, 13*nm, 7*nm, 70*deg)
def get_sample(omega):
particle = ba.Particle(material_particle, ff)
particle.rotate(ba.RotationZ(omega * deg))
particle.rotate(ba.RotationZ(omega*deg))
return std_samples.sas_sample_with_particle(particle)
......
......@@ -4,12 +4,12 @@ import bornagain as ba
from bornagain import ba_plot as bp, deg, nm, std_samples, std_simulations
material_particle = ba.RefractiveMaterial("Particle", 1e-6, 0)
ff = ba.Pyramid3(14 * nm, 6.8 * nm, 70 * deg)
ff = ba.Pyramid3(14*nm, 6.8*nm, 70*deg)
def get_sample(omega):
particle = ba.Particle(material_particle, ff)
particle.rotate(ba.RotationZ(omega * deg))
particle.rotate(ba.RotationZ(omega*deg))
return std_samples.sas_sample_with_particle(particle)
......
......@@ -4,12 +4,12 @@ import bornagain as ba
from bornagain import ba_plot as bp, deg, nm, std_samples, std_simulations
material_particle = ba.RefractiveMaterial("Particle", 1e-6, 0)
ff = ba.Pyramid4(10 * nm, 4 * nm, 70 * deg)
ff = ba.Pyramid4(10*nm, 4*nm, 70*deg)
def get_sample(omega):
particle = ba.Particle(material_particle, ff)
particle.rotate(ba.RotationZ(omega * deg))
particle.rotate(ba.RotationZ(omega*deg))
return std_samples.sas_sample_with_particle(particle)
......
......@@ -4,12 +4,12 @@ import bornagain as ba
from bornagain import ba_plot as bp, deg, nm, std_samples, std_simulations
material_particle = ba.RefractiveMaterial("Particle", 1e-6, 0)
ff = ba.Pyramid6(5.43 * nm, 6.8 * nm, 70 * deg)
ff = ba.Pyramid6(5.43*nm, 6.8*nm, 70*deg)
def get_sample(omega):
particle = ba.Particle(material_particle, ff)
particle.rotate(ba.RotationZ(omega * deg))
particle.rotate(ba.RotationZ(omega*deg))
return std_samples.sas_sample_with_particle(particle)
......
......@@ -6,14 +6,14 @@ import bornagain as ba
from bornagain import nm, deg
import bornplot as bp
det = ba.SphericalDetector(bp.simargs['n'], 5 * deg, 2.5 * deg, 2.5 * deg)
det = ba.SphericalDetector(bp.simargs['n'], 5*deg, 2.5*deg, 2.5*deg)
n = 4
results = []
for i in range(n):
omega = 90 * i / (n - 1)
omega = 90*i/(n - 1)
title = r'$\omega=%d^\circ$' % omega
ff = ba.CosineRipple(25 * nm, 10 * nm, 8 * nm)
trafo = ba.RotationZ(omega * deg)
ff = ba.CosineRipple(25*nm, 10*nm, 8*nm)
trafo = ba.RotationZ(omega*deg)
data = bp.run_simulation(det, ff, trafo)
results.append(bp.Result(data, title))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment