@@ -35,6 +35,7 @@
Loading
35 35
    TaskStatusEnum,
36 36
    TorsionDriveRecord,
37 37
    KVStore,
38 +
    CompressionEnum,
38 39
    prepare_basis,
39 40
)
40 41
from qcfractal.interface.models.records import RecordStatusEnum
@@ -2340,14 +2341,14 @@
Loading
2340 2341
2341 2342
        return tasks_c
2342 2343
2343 -
    def queue_mark_error(self, data: List[Tuple[int, str]]):
2344 +
    def queue_mark_error(self, data: List[Tuple[int, Dict[str, str]]]):
2344 2345
        """
2345 2346
        update the given tasks as errored
2346 2347
        Mark the corresponding result/procedure as Errored
2347 2348
2348 2349
        Parameters
2349 2350
        ----------
2350 -
        data : List[Tuple[int, str]]
2351 +
        data : List[Tuple[int, Dict[str, str]]]
2351 2352
            List of task ids and their error messages desired to be assigned to them.
2352 2353
2353 2354
        Returns
@@ -2379,7 +2380,7 @@
Loading
2379 2380
                .all()
2380 2381
            )
2381 2382
2382 -
            for (task_id, msg), task_obj, base_result in zip(sorted_data.items(), task_objects, base_results):
2383 +
            for (task_id, error_dict), task_obj, base_result in zip(sorted_data.items(), task_objects, base_results):
2383 2384
2384 2385
                task_ids.append(task_id)
2385 2386
                # update task
@@ -2391,7 +2392,8 @@
Loading
2391 2392
                base_result.manager_name = task_obj.manager
2392 2393
                base_result.modified_on = dt.utcnow()
2393 2394
2394 -
                err = KVStore(data=msg)
2395 +
                # Compress error dicts here. Should be fast, since errors are small
2396 +
                err = KVStore.compress(error_dict, CompressionEnum.lzma, 1)
2395 2397
                err_id = self.add_kvstore([err])["data"][0]
2396 2398
                base_result.error = err_id
2397 2399

@@ -280,8 +280,9 @@
Loading
280 280
281 281
            except Exception:
282 282
                msg = "Internal FractalServer Error:\n" + traceback.format_exc()
283 -
                logger.warning("update: ERROR\n{}".format(msg))
284 -
                error_data.append((task_id, msg))
283 +
                error = {"error_type": "internal_fractal_error", "error_message": msg}
284 +
                logger.error("update: ERROR\n{}".format(msg))
285 +
                error_data.append((task_id, error))
285 286
                task_failures += 1
286 287
287 288
        if task_totals:

@@ -9,7 +9,7 @@
Loading
9 9
import gzip
10 10
11 11
from enum import Enum
12 -
from typing import Any, Dict, Optional
12 +
from typing import Any, Dict, Optional, Union
13 13
14 14
from pydantic import Field, validator
15 15
from qcelemental.models import AutodocBaseSettings, Molecule, ProtoModel, Provenance
@@ -137,7 +137,7 @@
Loading
137 137
    @classmethod
138 138
    def compress(
139 139
        cls,
140 -
        input_str: str,
140 +
        input_data: Union[Dict[str, str], str],
141 141
        compression_type: CompressionEnum = CompressionEnum.none,
142 142
        compression_level: Optional[int] = None,
143 143
    ):
@@ -148,7 +148,10 @@
Loading
148 148
        If compression_level is None, but a compression_type is specified, an appropriate default level is chosen
149 149
        """
150 150
151 -
        data = input_str.encode()
151 +
        if isinstance(input_data, dict):
152 +
            input_data = json.dumps(input_data)
153 +
154 +
        data = input_data.encode()
152 155
153 156
        # No compression
154 157
        if compression_type is CompressionEnum.none:
Files Coverage
qcfractal 88.05%
Project Totals (69 files) 88.05%
1
coverage:
2
  ignore:
3
    - */tests/*
4
    - qcfractal/dashboard/* # early state
5
    - qcfractal/alembic/* # difficult to test
6
    - qcfractal/_version.py
7
    - setup.py
8
  status:
9
    patch: false
10
    project:
11
      default:
12
        threshold: 80%
13
comment:
14
  layout: "header"
15
  require_changes: false
16
  branches: null
17
  behavior: once
18
  flags: null
19
  paths: null
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading