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

Add SNEWSMessage class hierarchy. #81

Merged
merged 40 commits into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
6107499
Add SNEWSMessage class hierarchy.
Jun 2, 2023
4a19d52
Print schema. Rename validate function.
Jun 9, 2023
3189d1c
Test SNEWSMessageBuilder for tier message lists.
Jun 9, 2023
395b1bd
Refector message builder, enable to/from JSON.
Jun 10, 2023
75d31c5
markdown representations
KaraMelih Jun 26, 2023
d1630e2
times in timing series must be checked
KaraMelih Jun 26, 2023
9abf364
add a publisher
KaraMelih Jun 26, 2023
6e802e0
when sending avoid using other-tier keys in the meta
KaraMelih Jun 26, 2023
fe96e85
irrelevant fix
KaraMelih Jul 21, 2023
e3ad862
is valid method for coinc tier
KaraMelih Jul 21, 2023
bc1358d
check detector name in base, add SigTier is valid
KaraMelih Jul 21, 2023
d265589
is_valid method for Time,HB, and retr tiers
KaraMelih Jul 21, 2023
e3a9a0f
is_valid method for Time,HB, and retr tiers
KaraMelih Jul 21, 2023
cfdded7
rename functions
KaraMelih Jul 31, 2023
e954abe
convert message schema display
KaraMelih Jul 31, 2023
f36a761
return is_valid true, and keep tiernames
KaraMelih Jul 31, 2023
c9e593a
fetch and append machine time
KaraMelih Jul 31, 2023
8f9b48f
fix coincidence unit test
KaraMelih Jul 31, 2023
22c0348
fix significance unit test
KaraMelih Jul 31, 2023
73d0e50
fix timing unit test
KaraMelih Jul 31, 2023
fed3704
fix retraction unit test
KaraMelih Jul 31, 2023
2ac71b0
typo fix
KaraMelih Jul 31, 2023
70da7e1
new heartbeat test
KaraMelih Jul 31, 2023
d91a21c
fix test script
KaraMelih Jul 31, 2023
3fa4166
remove neutrino time from time tier fields
KaraMelih Jul 31, 2023
6bbb586
automated server connection test
KaraMelih Jul 31, 2023
2f569d7
test connection returns bool
KaraMelih Jul 31, 2023
034f71f
clean-up
KaraMelih Jul 31, 2023
37c5c4d
numpy requirement
KaraMelih Jul 31, 2023
96c8f84
turn json import into a classmethod
KaraMelih Jul 31, 2023
c34ae6c
set name echoes only when not returned
KaraMelih Jul 31, 2023
a818814
update notebooks
KaraMelih Jul 31, 2023
9df2dca
oopsie fix
KaraMelih Aug 2, 2023
6c44beb
Merge pull request #82 from SNEWS2/spt-msg-cls-full-integration
sybenzvi Sep 29, 2023
6d3d680
Remove Python 3.7 unit tests.
Sep 29, 2023
ca77238
adapt to new msg construction
KaraMelih Oct 4, 2023
f2c69b0
check p-value range for coincidence tier + improve md repr
KaraMelih Oct 4, 2023
755c017
set name, fetch if name has already been changed
KaraMelih Oct 5, 2023
c365af1
legacy. is test no longer under meta key, but CS uses this script to …
KaraMelih Oct 5, 2023
3c153bb
don't set the name, just get it
KaraMelih Oct 5, 2023
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
68 changes: 0 additions & 68 deletions .github/workflows/mac10-py37.yml

This file was deleted.

68 changes: 0 additions & 68 deletions .github/workflows/mac11-py37.yml

This file was deleted.

80 changes: 0 additions & 80 deletions .github/workflows/ubuntu20-py37-310.yml

This file was deleted.

85 changes: 0 additions & 85 deletions .github/workflows/ubuntu20-py37.yml

This file was deleted.

14 changes: 7 additions & 7 deletions docs/user/firedrills.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,24 @@ We would like to test two main interactions; **subscribing** & **publishing** t

- API:
```python
from snews_pt.snews_pub import SNEWSTiersPublisher
SNEWSTiersPublisher(detector_name='KamLAND',
from snews_pt.messages import SNEWSMessageBuilder
SNEWSMessageBuilder(detector_name='KamLAND',
neutrino_time="2022-02-28T04:31:08.678999",
p_val=0.000007,
machine_time="2022-02-28T04:31:09.778859",
firedrill_mode=True,
is_test=True,
).send_to_snews()
).send_messages()
```
or
or
```python
from snews_pt.snews_pub import SNEWSTiersPublisher
observation = SNEWSTiersPublisher.from_json('somejsonfile.json',
from snews_pt.messages import SNEWSMessageBuilder
observation = SNEWSMessageBuilder.from_json('somejsonfile.json',
detector_name='XENONnT',
firedrill_mode=True,
is_test=True,
comment="This is submitted from a json file")
observation.send_to_snews()
observation.send_messages()
```
Notice that `SNEWSTiersPublisher` returns an object which actually contains the decided tiers, and formatted messages.
One can play with this object before finally `send_to_snews()`.
Expand Down
10 changes: 6 additions & 4 deletions docs/user/publishing_protocols.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ The user can share as much information as they desire with one simple function c
sets the "Tier" and any additional information is passed under `meta` field.

The user can use `SNEWSTiersPublisher` to create observation message(s) and send them to snews.

```python
from snews_pt.snews_pub import SNEWSTiersPublisher
messages = SNEWSTiersPublisher(neutrino_time="2022-02-28T04:31:08.678999")
messages.send_to_snews()
from snews_pt.messages import SNEWSMessageBuilder

messages = SNEWSMessageBuilder(neutrino_time="2022-02-28T04:31:08.678999")
messages.send_messages()
```
User can also investigate their messages before sending it to SNEWS. The `SNEWSTiersPublisher` creates an object which contains
the generated and formatted messages. It can also tell you what "Tiers" are selected based on the input that is given.
Expand Down Expand Up @@ -92,7 +94,7 @@ Notice that your message can contain fields that correspond to several tiers e.g
In the example below `SNEWSTierPublisher` creates a message for "CoincidenceTier" because the `neutrino_time` is passed, and it creates
another message for the "Significance Tier" because the `p_values` together with the `t_bin_width` is passed.

Here the `p_val` is the p value of the detection and it is optional. The `detector_name` can be passed manually, however, if the name is initially set, this is also not needed.
Here the `p_val` is the p value of the detection, and it is optional. The `detector_name` can be passed manually, however, if the name is initially set, this is also not needed.

<img src="../example_publishing.png" alt="Publication example" width="2000"/>

Expand Down
Loading