-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
42 changed files
with
393 additions
and
353 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,7 +69,7 @@ class AnalyzedCoincidence(models.Model): | |
error_estimate = models.FloatField(null=True, blank=True) | ||
|
||
def __str__(self): | ||
return f"{self.coincidence} - {self.student}" | ||
return f'{self.coincidence} - {self.student}' | ||
|
||
class Meta: | ||
verbose_name = 'Analyzed coincidence' | ||
|
@@ -100,7 +100,7 @@ class Meta: | |
|
||
@property | ||
def name(self): | ||
return f"{self.first_name} {self.sur_name}" | ||
return f'{self.first_name} {self.sur_name}' | ||
|
||
def create_session(self): | ||
self.session_pending = False | ||
|
@@ -157,7 +157,7 @@ def find_coincidence(self, date, session): | |
all_coincidences = cq.any(stations) | ||
coincidences = cq.events_from_stations(all_coincidences, stations, n=3) | ||
for coincidence in coincidences: | ||
# Todo: Double check for multiple events from same station, | ||
# TODO: Double check for multiple events from same station, | ||
self.save_coincidence(coincidence, session) | ||
number_of_coincidences += 1 | ||
|
||
|
@@ -212,14 +212,14 @@ def generate_url(self): | |
def sendmail_request(self): | ||
subject = 'HiSPARC analysis session request' | ||
message = textwrap.dedent( | ||
f'''\ | ||
f"""\ | ||
Hello {self.name}, | ||
Please click on this link to confirm your request for an analysis session with jSparc: | ||
https://data.hisparc.nl/analysis-session/request/{self.url}/ | ||
Greetings, | ||
The HiSPARC Team''' | ||
The HiSPARC Team""", | ||
) | ||
sender = 'Beheer HiSPARC <[email protected]>' | ||
send_mail(subject, message, sender, [self.email], fail_silently=False) | ||
|
@@ -229,7 +229,7 @@ def sendmail_request(self): | |
def sendmail_created(self): | ||
subject = 'HiSPARC analysis session created' | ||
message = textwrap.dedent( | ||
f'''\ | ||
f"""\ | ||
Hello {self.name}, | ||
Your analysis session for jSparc has been created. | ||
|
@@ -244,15 +244,15 @@ def sendmail_created(self): | |
https://data.hisparc.nl/analysis-session/{slugify(self.sid)}/data/ | ||
Greetings, | ||
The HiSPARC Team''' | ||
The HiSPARC Team""", | ||
) | ||
sender = 'Beheer HiSPARC <[email protected]>' | ||
send_mail(subject, message, sender, [self.email], fail_silently=False) | ||
|
||
def sendmail_created_less(self): | ||
subject = 'HiSPARC analysis session created with less events' | ||
message = textwrap.dedent( | ||
f'''\ | ||
f"""\ | ||
Hello {self.name}, | ||
Your analysis session for jSparc has been created. | ||
|
@@ -269,23 +269,23 @@ def sendmail_created_less(self): | |
https://data.hisparc.nl/analysis-session/{slugify(self.sid)}/data/ | ||
Greetings, | ||
The HiSPARC Team''' | ||
The HiSPARC Team""", | ||
) | ||
sender = 'Beheer HiSPARC <[email protected]>' | ||
send_mail(subject, message, sender, [self.email], fail_silently=False) | ||
|
||
def sendmail_zero(self): | ||
subject = 'HiSPARC analysis session creation failed' | ||
message = textwrap.dedent( | ||
f'''\ | ||
f"""\ | ||
Hello {self.name}, | ||
Your analysis session for jSparc could not be created. | ||
Perhaps there was no data for the date and/or stations you selected. | ||
Please try selecting a different cluster or date. | ||
Greetings, | ||
The HiSPARC Team''' | ||
The HiSPARC Team""", | ||
) | ||
sender = 'Beheer HiSPARC <[email protected]>' | ||
send_mail(subject, message, sender, [self.email], fail_silently=False) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.