Skip to content

Commit

Permalink
Fix black
Browse files Browse the repository at this point in the history
  • Loading branch information
robertdstein committed Mar 27, 2024
1 parent 0deaaa0 commit ca4ff59
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 47 deletions.
14 changes: 9 additions & 5 deletions notebooks/Check_fields.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -54,25 +54,29 @@
"outputs": [],
"source": [
"def get_zquery_partnership(start_date=None, end_date=None):\n",
" \n",
"\n",
" date_format = \"%Y-%m-%d\"\n",
" \n",
"\n",
" if start_date is None:\n",
" now = datetime.datetime.now()\n",
" last_month = now - datetime.timedelta(days=30)\n",
" start_date = last_month.strftime(date_format)\n",
" if end_date is None:\n",
" now = datetime.datetime.now()\n",
" end_date = now.strftime(date_format)\n",
" \n",
"\n",
" # Convert to JD\n",
" jd_start = time.Time(start_date).jd\n",
" jd_end = time.Time(end_date).jd\n",
" # Do the Query to see what exists\n",
" zquery = query.ZTFQuery()\n",
" zquery.load_metadata(sql_query=\"pid>1 and obsjd BETWEEN {0} AND {1}\".format(jd_start, jd_end))# this will take about 1min\n",
" zquery.show_gri_fields(title=\"ZTF observations in from {0} to {1}\".format(start_date, end_date), grid=\"main\")\n"
" zquery.load_metadata(\n",
" sql_query=\"pid>1 and obsjd BETWEEN {0} AND {1}\".format(jd_start, jd_end)\n",
" ) # this will take about 1min\n",
" zquery.show_gri_fields(\n",
" title=\"ZTF observations in from {0} to {1}\".format(start_date, end_date),\n",
" grid=\"main\",\n",
" )"
]
},
{
Expand Down
10 changes: 7 additions & 3 deletions notebooks/Check_observations.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"outputs": [],
"source": [
"def get_ztf_data(date=None):\n",
" \"\"\"Function to grab data for a given date using ztfquery. \n",
" \"\"\"Function to grab data for a given date using ztfquery.\n",
" Date should be given in format YYYYMMDD, with the day being the UT day for the END of the night.\n",
" By default, today is selected\n",
" \"\"\"\n",
Expand Down Expand Up @@ -58,7 +58,11 @@
"source": [
"full_data = get_ztf_data()\n",
"\n",
"print(\"Most recent observation in database was at:\", full_data.data.iloc[-1][\"UT_START\"], \"(UT)\")"
"print(\n",
" \"Most recent observation in database was at:\",\n",
" full_data.data.iloc[-1][\"UT_START\"],\n",
" \"(UT)\",\n",
")"
]
},
{
Expand Down Expand Up @@ -147,7 +151,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.9"
"version": "3.10.9"
}
},
"nbformat": 4,
Expand Down
27 changes: 14 additions & 13 deletions notebooks/Neutrino_archival_search.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"outputs": [],
"source": [
"import logging\n",
"\n",
"logger = logging.getLogger(\"quiet_logger\")\n",
"logger.setLevel(logging.ERROR)"
]
Expand Down Expand Up @@ -99,7 +100,7 @@
}
],
"source": [
"nu = NeutrinoScanner(\"IC200530A\", logger=logger, t_offset=5.)"
"nu = NeutrinoScanner(\"IC200530A\", logger=logger, t_offset=5.0)"
]
},
{
Expand Down Expand Up @@ -272,12 +273,16 @@
"source": [
"from neutrino_scanner import NeutrinoScanner\n",
"from astropy.time import Time\n",
"nu = NeutrinoScanner(manual_args=(\n",
" \"LAT-ANTARES\", \n",
" [142.5603, +0.9, -0.9],\n",
" [-18.0672, +0.9, -0.9],\n",
" Time(\"2020-01-08T09:30:14.48\", format='isot', scale='utc')\n",
"), logger=logger)\n",
"\n",
"nu = NeutrinoScanner(\n",
" manual_args=(\n",
" \"LAT-ANTARES\",\n",
" [142.5603, +0.9, -0.9],\n",
" [-18.0672, +0.9, -0.9],\n",
" Time(\"2020-01-08T09:30:14.48\", format=\"isot\", scale=\"utc\"),\n",
" ),\n",
" logger=logger,\n",
")\n",
"nu.scan_cones()\n",
"nu.plot_overlap_with_observations()"
]
Expand All @@ -293,19 +298,15 @@
"fs = [542, 543, 544]\n",
"for f in fs:\n",
" ra, dec = ztfquery_fields.field_to_coords(f)[0]\n",
" print(f, ra, dec, ra-3.5, ra+3.5)"
" print(f, ra, dec, ra - 3.5, ra + 3.5)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"\n",
"\n",
"\n"
]
"source": []
},
{
"cell_type": "code",
Expand Down
4 changes: 3 additions & 1 deletion nuztf/skymap_scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,9 @@ def filter_f_no_prv(self, res: dict, t_max_jd=None) -> bool:
self.logger.debug(f"❌ {res['objectId']}: Outside of event contour.")
return False

self.logger.debug(f"✅ {res['objectId']}: Passes first filtering stage (no prv)")
self.logger.debug(
f"✅ {res['objectId']}: Passes first filtering stage (no prv)"
)

return True

Expand Down
48 changes: 24 additions & 24 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ slackeventsapi = {version = "^3.0.1", optional = true}


[tool.poetry.dev-dependencies]
black = "^23.1.0"
black = "^24.3.0"
coverage = "^6.0"
coveralls = "^3.3.1"
pytest = "^7.4.0"
Expand Down

0 comments on commit ca4ff59

Please sign in to comment.