Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump a bunch of versions #381

Merged
merged 4 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 8 additions & 15 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,23 @@
name: Dependabot auto-merge

on:
pull_request:
merge_group:
on: pull_request

permissions:
pull-requests: write
contents: write
pull-requests: write

jobs:
automerge:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
if: github.actor == 'dependabot[bot]'
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1.1.1
uses: dependabot/fetch-metadata@v1
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Echo auto-merge
run: echo "Update type is ${{steps.metadata.outputs.update-type}}, check is ${{contains(steps.metadata.outputs.update-type,'version-update:semver')}}"

- name: Enable auto-merge for Dependabot PRs
if: ${{contains(steps.metadata.outputs.update-type,'version-update:semver')}}
run: gh pr merge --auto --squash "$PR_URL"
if: steps.metadata.outputs.update-type == 'version-update:semver-patch'
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
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
Loading
Loading