diff --git a/CHANGELOG.md b/CHANGELOG.md index 3abd47c32..5b25f6e5f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Change Log +## Unreleased + +### Changes +- Some log levels have been adjusted ([#689](../../pull/689)) + ## Version 1.8.7 ### Improvements diff --git a/docs/source/conf.py b/docs/source/conf.py index 2b7f4f38b..6bf3dd401 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -66,6 +66,7 @@ # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = [] +html_static_path = ['static'] +html_css_files = ['custom.css'] autoclass_content = 'both' diff --git a/docs/source/index.rst b/docs/source/index.rst index f371d0c3d..184c9a906 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -43,4 +43,3 @@ Indices and tables * :ref:`genindex` * :ref:`modindex` -* :ref:`search` diff --git a/docs/source/static/custom.css b/docs/source/static/custom.css new file mode 100644 index 000000000..c6f682015 --- /dev/null +++ b/docs/source/static/custom.css @@ -0,0 +1,10 @@ +.indextable.genindextable td { + padding-right: 10px +} +.indextable.genindextable li { + word-break: break-word; +} +.indextable.genindextable a:before { + content: "\2022\00A0"; +} + diff --git a/girder_annotation/girder_large_image_annotation/models/annotation.py b/girder_annotation/girder_large_image_annotation/models/annotation.py index 8534a7b30..d0242ff63 100644 --- a/girder_annotation/girder_large_image_annotation/models/annotation.py +++ b/girder_annotation/girder_large_image_annotation/models/annotation.py @@ -938,7 +938,7 @@ def _similarElementStructure(self, a, b, parentKey=None): # noqa return True def validate(self, doc): - starttime = time.time() + startTime = lastTime = time.time() try: # This block could just use the json validator: # jsonschema.validate(doc.get('annotation'), @@ -951,7 +951,7 @@ def validate(self, doc): annot['elements'] = [] self.validatorAnnotation.validate(annot) lastValidatedElement = None - for element in elements: + for idx, element in enumerate(elements): if isinstance(element.get('id'), ObjectId): element['id'] = str(element['id']) # Handle elements with large arrays by checking that a @@ -972,10 +972,15 @@ def validate(self, doc): lastValidatedElement = element if key: element[key] = keydata + if time.time() - lastTime > 10: + logger.info('Validated %s of %d elements in %5.3fs', + idx + 1, len(elements), time.time() - startTime) + lastTime = time.time() annot['elements'] = elements except jsonschema.ValidationError as exp: raise ValidationException(exp) - logger.debug('Validated in %5.3fs' % (time.time() - starttime)) + if time.time() - startTime > 10: + logger.info('Validated in %5.3fs' % (time.time() - startTime)) elementIds = [entry['id'] for entry in doc['annotation'].get('elements', []) if 'id' in entry] if len(set(elementIds)) != len(elementIds): diff --git a/girder_annotation/girder_large_image_annotation/models/annotationelement.py b/girder_annotation/girder_large_image_annotation/models/annotationelement.py index bc73c3dee..e38f66f95 100644 --- a/girder_annotation/girder_large_image_annotation/models/annotationelement.py +++ b/girder_annotation/girder_large_image_annotation/models/annotationelement.py @@ -440,7 +440,7 @@ def updateElements(self, annotation): :param annotation: the annotation to save elements for. Modified. """ - startTime = time.time() + startTime = lastTime = time.time() elements = annotation['annotation'].get('elements', []) if not len(elements): return @@ -464,10 +464,11 @@ def updateElements(self, annotation): if 'id' not in entry['element']: entry['element']['id'] = str(res.inserted_ids[pos]) # If the whole insert is slow, log information about it. - if time.time() - startTime > 10: + if time.time() - lastTime > 10: logger.info('insert %d elements in %4.2fs (prep time %4.2fs), done %d/%d' % ( len(entries), time.time() - chunkStartTime, prepTime, chunk + len(entries), len(elements))) + lastTime = time.time() if time.time() - startTime > 10: logger.info('inserted %d elements in %4.2fs' % ( len(elements), time.time() - startTime))