Skip to content

Commit

Permalink
GH-128: removed obsolete comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mortenwh authored and akorosov committed Aug 17, 2020
1 parent 72b08f0 commit 704715d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
10 changes: 3 additions & 7 deletions geospaas/nansat_ingestor/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,6 @@ def get_or_create(self,
options = {}
try:
existing_ds = Dataset.objects.get(entry_id=entry_id)
# Since the entry_id should be unique, it would be a rather serious issue if multiple objects
# are returned here. I suggest to remove the exception Dataset.MultipleObjectsReturned to
# catch such a theoretical error..
#except (Dataset.DoesNotExist, Dataset.MultipleObjectsReturned):
except Dataset.DoesNotExist:
existing_ds = None
for name in default_char_fields:
Expand Down Expand Up @@ -136,9 +132,9 @@ def get_or_create(self,
geometry=WKTReader().read(n.get_border_wkt(nPoints=n_points)))[0]

# create dataset
# - the get_or_create method should use get_or_create here as well - see issue #127
# - also read entry_id from options dict
ds, created = Dataset.objects.get_or_create(entry_id=options['entry_id'], defaults={
# - the get_or_create method should use get_or_create here as well,
# or its name should be changed - see issue #127
ds, created = Dataset.objects.update_or_create(entry_id=options['entry_id'], defaults={
'time_coverage_start': n.get_metadata('time_coverage_start'),
'time_coverage_end': n.get_metadata('time_coverage_end'),
'source': source,
Expand Down
5 changes: 0 additions & 5 deletions geospaas/nansat_ingestor/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ class BasetForTests(TestCase):
"""Base class for creating the testing environment"""
fixtures = ['vocabularies', 'catalog']
predefined_metadata_dict = {
# In development, it does not necessarily make sense to provide the entry_id from metadata.
# Also, Nansat should not set the entry_id, as this would then be different each time a new
# Nansat instance is created (provided uuid is used). I propose to remove it from this dict,
# and test both with and without the enty_id.
#'entry_id': 'UNIQUE_ID_1000',
'platform': '{"Category": "Earth Observation Satellites", "Series_Entity": "", "Short_Name": "ENVISAT", "Long_Name": "Environmental Satellite"}',
'instrument': '{"Category": "Earth Remote Sensing Instruments", "Class": "Passive Remote Sensing", "Type": "Spectrometers/Radiometers", "Subtype": "Imaging Spectrometers/Radiometers", "Short_Name": "MERIS", "Long_Name": "Medium Resolution Imaging Spectrometer"}',
'time_coverage_start': '2011-05-03T10:56:38.995099',
Expand Down

0 comments on commit 704715d

Please sign in to comment.