Skip to content

Commit

Permalink
Don't remove my prints
Browse files Browse the repository at this point in the history
  • Loading branch information
Cadair committed Dec 6, 2024
1 parent 6aef187 commit 223bd96
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ extend-ignore = [
"E402", # Module imports not at top of file
"A001",
"BLE001",
"T201",
]
"docs/*.py" = [
"INP001", # File is part of an implicit namespace package.
Expand Down Expand Up @@ -109,6 +110,9 @@ extend-ignore = [
"dkist/utils/sysinfo.py" = [
"T20",
]
"dkist/net/globus/auth.py" = [
"T201",
]

[lint.flake8-import-conventions.extend-aliases]
"astropy.units" = "u"
Expand Down
1 change: 1 addition & 0 deletions dkist/dataset/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ def pp_matrix(wcs):
----------
wcs : `BaseHighLevelWCS` or `BaseLowLevelWCS`
"""
print(_get_pp_matrix(wcs)) # noqa: T201


def extract_pc_matrix(headers, naxes=None):
Expand Down
3 changes: 3 additions & 0 deletions dkist/net/globus/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ def do_native_app_authentication(client_id, requested_scopes=None): # pragma: n
url = client.oauth2_get_authorize_url()

webbrowser.open(url, new=1)
print("Waiting for completion of Globus Authentication in your webbrowser...")
print(f"If your webbrowser has not opened, please go to {url} to authenticate with globus.")

try:
auth_code = server.wait_for_code()
Expand Down Expand Up @@ -209,6 +211,7 @@ def do_reauth(*args, **kwargs):
# older versions of the globus_sdk use raw_text, which is now deprecated
response_text = getattr(e, "text", "") or getattr(e, "raw_text", "")
if e.http_status == 400 and "invalid_grant" in response_text:
print("Globus login has expired.")
get_refresh_token_authorizer(force_reauth=True)
return func(*args, **kwargs)

Expand Down
7 changes: 7 additions & 0 deletions dkist/tests/generate_aia_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ def main():
a.jsoc.Series("aia.lev1_euv_12s"), a.jsoc.Segment("image"),
a.jsoc.Notify("[email protected]"))

print(results)

files = Fido.fetch(results, path=str(path))

Expand Down Expand Up @@ -185,7 +186,9 @@ def main():
wcs = gwcs.wcs.WCS(forward_transform=hcubemodel, input_frame=detector_frame,
output_frame=sky_frame)

print(repr(wcs))

print(wcs(*[1*u.pix]*4, with_units=True))

ea = references_from_filenames(cube, relative_to=str(path))

Expand All @@ -198,10 +201,14 @@ def main():
# ff.write_to("test.asdf")
filename = str(path / f"aia_{time_coords[0]}.asdf")
ff.write_to(filename)
print(f"Saved to : {filename}")

# import sys; sys.exit(0)

ds = load_dataset(str(path))
print(repr(ds))
print(repr(ds.wcs))
print(ds.wcs(*[1*u.pix]*4, with_units=True))


if __name__ == "__main__":
Expand Down
3 changes: 3 additions & 0 deletions dkist/tests/generate_eit_test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ def main():
wcs = gwcs.wcs.WCS(forward_transform=hcubemodel, input_frame=detector_frame,
output_frame=sky_frame)

print(repr(wcs))

print(wcs(*[1*u.pix]*3, with_units=True))

hp = HeaderParser.from_headers(headers, filenames=files, validate=False)
ac = references_from_filenames(hp, hdu_index=0, relative_to=str(rootdir / "EIT"))
Expand All @@ -139,6 +141,7 @@ def main():
with asdf.AsdfFile(tree) as ff:
filename = rootdir / "EIT" / "eit_test_dataset.asdf"
ff.write_to(filename)
print(f"Saved to : {filename}")


ds.plot()
Expand Down
1 change: 1 addition & 0 deletions dkist/tests/generate_eit_tiled_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ def data(self):

asdf_filename = rootdir / "test_tiled_dataset.asdf"
ds = dataset_from_fits(tempdir, asdf_filename)
print(ds)
5 changes: 5 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
except Exception:
missing_requirements.append(requirement.name)
if missing_requirements:
print(
f"The {' '.join(missing_requirements)} package(s) could not be found and "
"is needed to build the documentation, please install the 'docs' requirements."
)
sys.exit(1)

# -- Read the Docs Specific Configuration --------------------------------------
Expand Down Expand Up @@ -141,6 +145,7 @@

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.

from dkist_sphinx_theme.conf.theme import *

# Render inheritance diagrams in SVG
Expand Down

0 comments on commit 223bd96

Please sign in to comment.