Skip to content

Commit

Permalink
fix: perform sanity checks for datasets (close #27)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Sep 7, 2021
1 parent 2cffeb3 commit ce89b55
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
- feat: implement download manager
- feat: rename first tab to "Find Data" and allow searching for
private datasets
- fix: perform sanity checks for datasets (#27)
- enh: allow to download all resources of a collection (#13)
- enh: implement search for packages the user has access to
- enh: implement DBInterrogator functions for generating a private
user db (partly #5)
- setup: bump dclab from 0.35.3 to 0.35.5
- ref: simplify `dbmodel` submodule (just use Interrogator)
- ref: expand dedicated `api` submodule (moved dunctions from
`upload.dataset`)
Expand Down
10 changes: 9 additions & 1 deletion dcoraid/upload/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,17 @@ def task_compress_resources(self):
self.set_state("compress")
for ii, path in enumerate(list(self.paths)):
if path.suffix in [".rtdc", ".dc"]: # do we have an .rtdc file?
# check for compression
with IntegrityChecker(path) as ic:
# check for compression
cdata = ic.check_compression()[0].data
# perform a sanity check
insane = [c.msg for c in ic.sanity_check()]
if insane:
# The user is responsible of cleaning up the mess.
# We just make sure no dirty data gets uploaded to
# DCOR.
raise IOError(f"Sanity check failed for {path}!\n"
+ "\n".join(insane))
if cdata["uncompressed"]: # (partially) not compressed?
res_dir = self.cache_dir / "{}".format(ii)
res_dir.mkdir(exist_ok=True, parents=True)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
description=description,
long_description=open('README.rst').read() if exists('README.rst') else '',
install_requires=["appdirs", # cache directory for data compression
"dclab[dcor]==0.35.3", # pin for triage
"dclab[dcor]==0.35.5", # pin for triage
"pyqt5",
"requests>=2.13",
"requests_toolbelt", # multipart uploads with progress
Expand Down

0 comments on commit ce89b55

Please sign in to comment.