Skip to content

Commit

Permalink
Update style for most recent version of black (#496)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdickinson committed Mar 7, 2022
1 parent 4530c9d commit bb3b072
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion ci/python_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def current_platform():
Return a string representing the current platform, in the format
accepted by EDM.
"""
is_64bits = sys.maxsize > 2 ** 32
is_64bits = sys.maxsize > 2**32
platform = sys.platform
if platform.startswith("win32"):
return "win-x86_64" if is_64bits else "win-x86"
Expand Down
2 changes: 1 addition & 1 deletion docs/source/guide/examples/headless.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
)


def approximate_pi(sample_count=10 ** 8, report_interval=10 ** 6):
def approximate_pi(sample_count=10**8, report_interval=10**6):
"""
Yield successive approximations to π via Monte Carlo methods.
"""
Expand Down
6 changes: 3 additions & 3 deletions docs/source/guide/examples/interruptible_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@
from traitsui.api import HGroup, Item, UItem, View


def approximate_pi(sample_count=10 ** 8):
def approximate_pi(sample_count=10**8):
# approximate pi/4 by throwing points at a unit square and
# counting the proportion that land in the quarter circle.
inside = total = 0
for i in range(sample_count):
if i > 0 and i % 10 ** 5 == 0:
if i > 0 and i % 10**5 == 0:
yield 4 * inside / total # <- partial result
x, y = random.random(), random.random()
inside += x * x + y * y < 1
Expand All @@ -62,7 +62,7 @@ class InterruptibleTaskExample(HasStrictTraits):
future = Instance(IterationFuture)

#: Number of points to use.
sample_count = Int(10 ** 8)
sample_count = Int(10**8)

#: Message about state of calculation.
message = Str("No previous calculation runs")
Expand Down
4 changes: 2 additions & 2 deletions docs/source/guide/examples/non_interruptible_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
from traitsui.api import HGroup, Item, UItem, View


def approximate_pi(sample_count=10 ** 8):
def approximate_pi(sample_count=10**8):
# approximate pi/4 by throwing points at a unit square and
# counting the proportion that land in the quarter circle.
inside = total = 0
Expand All @@ -60,7 +60,7 @@ class NonInterruptibleTaskExample(HasStrictTraits):
future = Instance(CallFuture)

#: Number of points to use.
sample_count = Int(10 ** 8)
sample_count = Int(10**8)

#: Message about state of calculation.
message = Str("No previous calculation runs")
Expand Down
2 changes: 1 addition & 1 deletion docs/source/guide/examples/pi_iterations.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def pi_iterations(chunk_size):
# https://en.wikipedia.org/wiki/Binomial_proportion_confidence_interval
approximation = 4 * ninside / nsamples
noutside = nsamples - ninside
error = 7.839856 * np.sqrt(ninside * noutside / (nsamples ** 3))
error = 7.839856 * np.sqrt(ninside * noutside / nsamples**3)
yield nsamples, approximation, error


Expand Down
4 changes: 2 additions & 2 deletions docs/source/guide/examples/prime_counting.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,10 @@ class PrimeCounter(HasStrictTraits):
future = Instance(ProgressFuture)

#: Number to count primes up to.
limit = Int(10 ** 6)
limit = Int(10**6)

#: Chunk size to use for the calculation.
chunk_size = Int(10 ** 4)
chunk_size = Int(10**4)

#: Button to start the calculation.
count = Button()
Expand Down

0 comments on commit bb3b072

Please sign in to comment.