Skip to content

Commit 6e92f7a

Browse files
committed
fix some typos
1 parent 730239d commit 6e92f7a

File tree

3 files changed

+17
-18
lines changed

3 files changed

+17
-18
lines changed

tom_swift/swift.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class SwiftObservationForm(BaseObservationForm):
8282
initial=SWIFT_URGENCY_CHOICES[2])
8383

8484
#
85-
# Observation Type ('Specroscopy', 'Light Curve', 'Position', 'Timing')
85+
# Observation Type ('Spectroscopy', 'Light Curve', 'Position', 'Timing')
8686
#
8787
obs_type = forms.ChoiceField(
8888
required=True,
@@ -134,7 +134,7 @@ class SwiftObservationForm(BaseObservationForm):
134134
required=False, label='Science Justification',
135135
widget=forms.Textarea(attrs={
136136
'rows': 8,
137-
'placeholder': 'A pursuasive paragraph or two explaining why this object requires rapid observation.'})
137+
'placeholder': 'A persuasive paragraph or two explaining why this object requires rapid observation.'})
138138
)
139139

140140
#
@@ -151,7 +151,7 @@ class SwiftObservationForm(BaseObservationForm):
151151
#
152152
# Monitoring requests
153153
#
154-
exp_time_per_visit = forms.FloatField(required=False, label='Exposure time per visit(s) [s]')
154+
exp_time_per_visit = forms.FloatField(required=False, label='Exposure time per visit [s]')
155155
num_of_visits = forms.IntegerField(
156156
required=False,
157157
label='Number of visits [integer]',
@@ -349,8 +349,8 @@ def is_valid(self):
349349
# validate_observation needs to return a list of (field, error) tuples
350350
# if the list is empty, then the observation is valid
351351
#
352-
# in order to call self.add_error(field, error), the field given must match the
353-
# a field declared on the Form, Thus, the form field names must match the properties
352+
# in order to call self.add_error(field, error), the field given must match a
353+
# field declared on the Form, thus the form field names must match the properties
354354
# of the swifttoolkit.Swift_TOO object (unless we want to maintain a mapping between
355355
# the two). NB: field can be None.
356356
#
@@ -379,7 +379,7 @@ def observation_payload(self):
379379
plus the target information should be sufficient. See _configure_too() for how
380380
the observation_payload is used to configure the TOO attributes.
381381
"""
382-
# At the moment it's unclear why the obeervation_payload needs to differ from
382+
# At the moment it's unclear why the observation_payload needs to differ from
383383
# the form.cleaned_data...
384384
payload = self.cleaned_data.copy() # copy() just to be safe
385385

@@ -425,7 +425,7 @@ def get_facility_context_data(self, **kwargs):
425425
'username': username,
426426
}
427427

428-
# get the resovled target info from the SwiftAPI
428+
# get the resolved target info from the SwiftAPI
429429
target = kwargs['target']
430430
resolved_target = self.swift_api.resolve_target(target)
431431
if resolved_target:
@@ -447,7 +447,7 @@ def all_data_products(self, observation_record):
447447
data_products = super().all_data_products(observation_record)
448448
logger.debug(f'all_data_products: {data_products}')
449449
# TODO: right now we just extend this to log a debug message. So remove this
450-
# and just let the super class method handle it, when we're finished developing.
450+
# and just let the super class method handle it, when we're finished developing.
451451
return data_products
452452

453453
def data_products(self, observation_id, product_id=None):
@@ -467,7 +467,7 @@ def get_observation_url(self, observation_id):
467467

468468
def get_observing_sites(self):
469469
"""Normally this would return an iterable dictionary of site LAT,LON,ELV values
470-
to be used for target visibiliy window calculations. See, for example,
470+
to be used for target visibility window calculations. See, for example,
471471
tom_base/tom_observations/facilities/ocs.py::OCSSettings.get_sites()
472472
473473
Swift is entirely different. Just return and empty dict for now.
@@ -746,12 +746,12 @@ def submit_observation(self, observation_payload) -> [()]:
746746

747747
if self.swift_api.too.debug:
748748
# this was a debug submission and thus, no TOO was made and
749-
# the too_id returned in the too.status is points to nothing.
749+
# the too_id returned in the too.status points to nothing.
750750
logger.warning(f'submit_observation - DEBUG submission - too_id: {too_id} is not real.')
751751
else:
752752
logger.error(f'submit_observation - too.status.status: {self.swift_api.too.status.status}')
753753

754-
# TODO: remove this -- it is only for debugging/development
754+
# TODO: remove this -- it is only for debugging/development
755755
# self.swift_api.too.status.too_id = 19529 # an actual NCG1566 TOO
756756

757757
return [too_id]

tom_swift/swift_api.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
class SwiftAPI:
2828
"""This is the interface between the SwiftFacility and the swifttools.swift_too classes.
2929
30-
This keeps the SwiftFacility class focued on implementing it's super class methods and separates
30+
This keeps the SwiftFacility class focused on implementing its superclass methods and separates
3131
the SwiftFacility from the swifttools.swift_too classes.
3232
"""
3333
def __init__(self, debug=True):
@@ -96,18 +96,17 @@ def resolve_target(self, target: Target):
9696
('Other (please specify)', 'Other (please specify)'),
9797
]
9898

99+
99100
#
100101
# Observation Types
101102
#
102103
# Note that:
103104
# >>> TOO().obs_types
104105
# ['Spectroscopy', 'Light Curve', 'Position', 'Timing']
105-
106-
107106
def get_observation_type_choices():
108107
"""Returns a list of tuples for the observation type choices.
109108
110-
Since the TOO() object has propperty describing the valid observation types,
109+
Since the TOO() object has property describing the valid observation types,
111110
use that to create the choices list of tuples (e.g. [('Spectroscopy', 'Spectroscopy'), ('Light Curve',
112111
'Light Curve'), ...]).
113112
"""
@@ -153,7 +152,7 @@ def get_observation_type_choices():
153152
# UVOT Modes
154153
#
155154

156-
# >>> too.uvot_mode = 0x01AB # Assign too.uvot_mode as a Hexidecimal number:
155+
# >>> too.uvot_mode = 0x01AB # Assign too.uvot_mode as a Hexadecimal number:
157156
# >>> too.uvot_mode # It's reported as a Hex string:
158157
# '0x01ab'
159158
# >>> type(too.uvot_mode)
@@ -168,7 +167,7 @@ def get_observation_type_choices():
168167
def get_monitoring_unit_choices():
169168
"""Returns a list of tuples for the monitoring frequency unit choices.
170169
171-
Since the TOO() object has propperty describing the valid monitoring frequency units,
170+
Since the TOO() object has property describing the valid monitoring frequency units,
172171
use that to create the choices list of tuples (e.g. [('day', 'day'), ('week', 'week'), ...]).
173172
"""
174173
monitoring_unit_choices = []

tom_swift/templates/tom_swift/observation_form.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ <h4>Resolved Target Information ({{ resolver }})</h4>
149149
<dd class="col-sm-6">{{ resolved_target_dec|floatformat:4 }}</dd>
150150
</dl>
151151
<hr>
152-
<!-- display tom_swift Facility verison -->
152+
<!-- display tom_swift Facility version -->
153153
<p><em>TOM Toolit Facility (<a href="https://github.com/TOMToolkit/tom_swift">tom_swift</a>) version {{ version }}</em></p>
154154
</div>
155155
<!-- Column 2 -->

0 commit comments

Comments
 (0)