Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
akoumjian committed Dec 6, 2024
1 parent 7941e9a commit f9ab7ab
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions src/adam_core/coordinates/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def cartesian_to_spherical(
"""
# Define chunk size
chunk_size = 50

# Process in chunks
coords_spherical_chunks = []
for cartesian_chunk in process_in_chunks(coords_cartesian, chunk_size):
Expand All @@ -173,7 +173,7 @@ def cartesian_to_spherical(

# Concatenate chunks and remove padding
coords_spherical = jnp.concatenate(coords_spherical_chunks, axis=0)
coords_spherical = coords_spherical[:len(coords_cartesian)]
coords_spherical = coords_spherical[: len(coords_cartesian)]

return coords_spherical

Expand Down Expand Up @@ -289,7 +289,7 @@ def spherical_to_cartesian(
vy : y-velocity in the same units of y per arbitrary unit of time.
vz : z-velocity in the same units of z per arbitrary unit of time.
"""
# Define chunk size
# Define chunk size
chunk_size = 50

# Process in chunks
Expand All @@ -300,7 +300,7 @@ def spherical_to_cartesian(

# Concatenate chunks and remove padding
coords_cartesian = jnp.concatenate(coords_cartesian_chunks, axis=0)
coords_cartesian = coords_cartesian[:len(coords_spherical)]
coords_cartesian = coords_cartesian[: len(coords_spherical)]

return coords_cartesian

Expand Down Expand Up @@ -601,7 +601,7 @@ def cartesian_to_keplerian(

# Concatenate chunks and remove padding
coords_keplerian = jnp.concatenate(coords_keplerian_chunks, axis=0)
coords_keplerian = coords_keplerian[:len(coords_cartesian)]
coords_keplerian = coords_keplerian[: len(coords_cartesian)]

return coords_keplerian

Expand Down Expand Up @@ -995,7 +995,7 @@ def keplerian_to_cartesian(
coords_cartesian_chunks = []
for keplerian_chunk, mu_chunk in zip(
process_in_chunks(coords_keplerian, chunk_size),
process_in_chunks(mu, chunk_size)
process_in_chunks(mu, chunk_size),
):
coords_cartesian_chunk = _keplerian_to_cartesian_a_vmap(
keplerian_chunk, mu_chunk, max_iter, tol
Expand All @@ -1004,7 +1004,7 @@ def keplerian_to_cartesian(

# Concatenate chunks and remove padding
coords_cartesian = jnp.concatenate(coords_cartesian_chunks, axis=0)
coords_cartesian = coords_cartesian[:len(coords_keplerian)]
coords_cartesian = coords_cartesian[: len(coords_keplerian)]

return coords_cartesian

Expand Down Expand Up @@ -1254,7 +1254,7 @@ def cometary_to_cartesian(
for cometary_chunk, t0_chunk, mu_chunk in zip(
process_in_chunks(coords_cometary, chunk_size),
process_in_chunks(t0, chunk_size),
process_in_chunks(mu, chunk_size)
process_in_chunks(mu, chunk_size),
):
coords_cartesian_chunk = _cometary_to_cartesian_vmap(
cometary_chunk, t0_chunk, mu_chunk, max_iter, tol
Expand All @@ -1263,7 +1263,7 @@ def cometary_to_cartesian(

# Concatenate chunks and remove padding
coords_cartesian = jnp.concatenate(coords_cartesian_chunks, axis=0)
coords_cartesian = coords_cartesian[:len(coords_cometary)]
coords_cartesian = coords_cartesian[: len(coords_cometary)]

return coords_cartesian

Expand Down
2 changes: 1 addition & 1 deletion src/adam_core/utils/chunking.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ def process_in_chunks(array, chunk_size):
chunk = array[i : i + chunk_size]
if chunk.shape[0] < chunk_size:
chunk = pad_to_fixed_size(chunk, (chunk_size,) + chunk.shape[1:])
yield chunk
yield chunk

0 comments on commit f9ab7ab

Please sign in to comment.