Skip to content

Commit 947b469

Browse files
committed
added ruff
1 parent 5428974 commit 947b469

11 files changed

+138
-39
lines changed

arc/advanced/population_lifetime.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# -*- coding: utf-8 -*-
2+
# ruff: noqa: E741
23
from scipy.integrate import odeint
34
from lmfit import minimize, Parameters, report_fit
45
import matplotlib.pyplot as plt

arc/alkali_atom_data.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# -*- coding: utf-8 -*-
2+
# ruff: noqa: E741
23
"""
34
This module specifies properties of individual alkali metals.
45

arc/alkali_atom_functions.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# -*- coding: utf-8 -*-
2+
# ruff: noqa: E741
23
"""
34
Implements general single-atom calculations
45
@@ -46,7 +47,7 @@
4647
import sys
4748
import os
4849

49-
from typing import List, Union, Tuple, cast, Tuple, Any, Callable
50+
from typing import List, Union, cast, Tuple, Any, Callable
5051

5152
if sys.version_info > (2,):
5253
xrange = range
@@ -3084,9 +3085,7 @@ def getLandegfExact(
30843085
f * (f + 1) - self.I * (self.I + 1) + j * (j + 1.0)
30853086
) / (2 * f * (f + 1.0)) + self.gI * (
30863087
f * (f + 1.0) + self.I * (self.I + 1.0) - j * (j + 1.0)
3087-
) / (
3088-
2.0 * f * (f + 1.0)
3089-
)
3088+
) / (2.0 * f * (f + 1.0))
30903089
return gf
30913090

30923091
def getHFSEnergyShift(

arc/arc_c_extensions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
def NumerovWavefunction(*args):
2-
pass # noqa: W292
2+
pass

arc/calculations_atom_pairstate.py

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,31 @@
11
# -*- coding: utf-8 -*-
2+
# ruff: noqa: E741
23

34
"""
4-
Pair-state basis level diagram calculations
5-
6-
Calculates Rydberg spaghetti of level diagrams, as well as pertubative C6
7-
and similar properties. It also allows calculation of Foster resonances
8-
tuned by DC electric fields.
9-
10-
Example:
11-
Calculation of the Rydberg eigenstates in pair-state basis for Rubidium
12-
in the vicinity of the
13-
:math:`|60~S_{1/2}~m_j=1/2,~60~S_{1/2}~m_j=1/2\\rangle` state. Colour
14-
highlights coupling strength from state :math:`6~P_{1/2}~m_j=1/2` with
15-
:math:`\\pi` (:math:`q=0`) polarized light.
16-
eigenstates::
17-
18-
from arc import *
19-
calc1 = PairStateInteractions(Rubidium(), 60, 0, 0.5, 60, 0, 0.5,0.5, 0.5)
20-
calc1.defineBasis( 0., 0., 4, 5,10e9)
21-
# optionally we can save now results of calculation for future use
22-
saveCalculation(calc1,"mycalculation.pkl")
23-
calculation1.diagonalise(linspace(1,10.0,30),250,progressOutput = True,drivingFromState=[6,1,0.5,0.5,0])
24-
calc1.plotLevelDiagram()
25-
calc1.ax.set_xlim(1,10)
26-
calc1.ax.set_ylim(-2,2)
27-
calc1.showPlot()
5+
Pair-state basis level diagram calculations
6+
7+
Calculates Rydberg spaghetti of level diagrams, as well as pertubative C6
8+
and similar properties. It also allows calculation of Foster resonances
9+
tuned by DC electric fields.
10+
11+
Example:
12+
Calculation of the Rydberg eigenstates in pair-state basis for Rubidium
13+
in the vicinity of the
14+
:math:`|60~S_{1/2}~m_j=1/2,~60~S_{1/2}~m_j=1/2\\rangle` state. Colour
15+
highlights coupling strength from state :math:`6~P_{1/2}~m_j=1/2` with
16+
:math:`\\pi` (:math:`q=0`) polarized light.
17+
eigenstates::
18+
19+
from arc import *
20+
calc1 = PairStateInteractions(Rubidium(), 60, 0, 0.5, 60, 0, 0.5,0.5, 0.5)
21+
calc1.defineBasis( 0., 0., 4, 5,10e9)
22+
# optionally we can save now results of calculation for future use
23+
saveCalculation(calc1,"mycalculation.pkl")
24+
calculation1.diagonalise(linspace(1,10.0,30),250,progressOutput = True,drivingFromState=[6,1,0.5,0.5,0])
25+
calc1.plotLevelDiagram()
26+
calc1.ax.set_xlim(1,10)
27+
calc1.ax.set_ylim(-2,2)
28+
calc1.showPlot()
2829
2930
"""
3031

arc/calculations_atom_single.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# -*- coding: utf-8 -*-
2-
2+
# ruff: noqa: E741
33
"""
4-
This module provides calculations of single-atom properties.
4+
This module provides calculations of single-atom properties.
55
6-
Included calculations are Stark maps, level plot visualisations,
7-
lifetimes and radiative decays.
6+
Included calculations are Stark maps, level plot visualisations,
7+
lifetimes and radiative decays.
88
99
"""
1010

@@ -611,9 +611,7 @@ def __init__(self, atom):
611611
See also:
612612
:obj:`eFieldList`, :obj:`highlight`, :obj:`diagonalise`
613613
"""
614-
self.highlight = (
615-
[]
616-
) # contribution of initial state there (overlap |<original state | given state>|^2)
614+
self.highlight = [] # contribution of initial state there (overlap |<original state | given state>|^2)
617615
"""
618616
`highlight[i]` is an array of values measuring highlighted feature in the
619617
eigenstates at electric field intensity `eFieldList[i]`. E.g. `highlight[i][j]`

arc/divalent_atom_data.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# -*- coding: utf-8 -*-
2+
# ruff: noqa: E741
23

34
"""
45
Data sources

arc/divalent_atom_functions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# -*- coding: utf-8 -*-
2+
# ruff: noqa: E741
23
from __future__ import division, print_function, absolute_import
34
from arc.alkali_atom_functions import AlkaliAtom, printStateLetter
45
from arc.wigner import Wigner3j, Wigner6j

arc/web_functionality.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# ruff: noqa: E741
2+
13
from __future__ import print_function, absolute_import
24

35
import sys

arc/wigner.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,14 @@ def Wigner6j(j1, j2, j3, J1, J2, J3, verbose=False):
246246
msg = "WARNING!!\n" + msg
247247
msg += (
248248
"For the 6j-Symbol:\n ⎰%3.1f %3.1f %3.1f⎱\n ⎱%3.1f %3.1f %3.1f⎰"
249-
% (j1, j2, j3, J1, J2, J3)
249+
% (
250+
j1,
251+
j2,
252+
j3,
253+
J1,
254+
J2,
255+
J3,
256+
)
250257
)
251258
if verbose:
252259
print(msg)
@@ -271,7 +278,14 @@ def Wigner6j(j1, j2, j3, J1, J2, J3, verbose=False):
271278
msg = "WARNING!!\n" + msg
272279
msg += (
273280
"For the 6j-Symbol:\n ⎰%3.1f %3.1f %3.1f⎱\n ⎱%3.1f %3.1f %3.1f⎰"
274-
% (j1, j2, j3, J1, J2, J3)
281+
% (
282+
j1,
283+
j2,
284+
j3,
285+
J1,
286+
J2,
287+
J3,
288+
)
275289
)
276290
msg += "\n6j-Symbol is undefined when any triad has a non-integer sum"
277291
if verbose:

0 commit comments

Comments
 (0)