Skip to content

Commit

Permalink
Merge pull request #126 from ComPlat/116-add-linear-sweep-voltammetry…
Browse files Browse the repository at this point in the history
…-to-data-types

Added new data type
  • Loading branch information
StarmanMartin authored Nov 20, 2024
2 parents f830f8a + 7fe10d2 commit 0d7e689
Show file tree
Hide file tree
Showing 5 changed files with 3,445 additions and 163 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ __pycache__/
test_manager/test_readers.py
/test_manager/test_profiles.py
/test_files/

/.venv/
logs/

1 change: 1 addition & 0 deletions converter_app/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
'THERMOGRAVIMETRIC ANALYSIS',
'UV-VIS',
'X-RAY DIFFRACTION',
'LINEAR SWEEP VOLTAMMETRY',
)

DATA_CLASSES = (
Expand Down
8 changes: 7 additions & 1 deletion test_manager/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import argparse
import datetime
import importlib
import json
import os
Expand All @@ -24,6 +25,10 @@
from converter_app.models import File
from converter_app.readers import READERS as registry

def _json_default(o):
if isinstance(o, (datetime.date, datetime.datetime)):
return o.isoformat()


def generate_expected_results(src_path, file, res_path, _unused):
src_path_file = os.path.join(src_path, file)
Expand All @@ -42,7 +47,8 @@ def generate_expected_results(src_path, file, res_path, _unused):
reader = registry.match_reader(File(file_storage))
if reader:
reader.process()
content = json.dumps(reader.as_dict)
content = json.dumps(reader.as_dict,
default=_json_default)
with open(final_targe_file, 'w+', encoding='utf8') as f_res:
f_res.write(content)
f_res.close()
Expand Down

Large diffs are not rendered by default.

Loading

0 comments on commit 0d7e689

Please sign in to comment.