Commit ef739ca5 authored by Aurélien Campéas's avatar Aurélien Campéas
Browse files

util: move contents of helper module there

We do not need two such modules.
parent 733e3d1efc5b
import tempfile
import shutil
from contextlib import contextmanager
from pathlib import Path
@contextmanager
def tempdir(suffix='', prefix='tmp'):
tmp = tempfile.mkdtemp(suffix=suffix, prefix=prefix)
try:
yield Path(tmp)
finally:
shutil.rmtree(tmp)
......@@ -3,6 +3,10 @@ import zlib
import hashlib
import logging
import threading
import tempfile
import shutil
from contextlib import contextmanager
from pathlib import Path
import numpy as np
import pandas as pd
......@@ -10,6 +14,15 @@ from pandas.api.types import is_datetimetz
from sqlalchemy.sql.expression import text
@contextmanager
def tempdir(suffix='', prefix='tmp'):
tmp = tempfile.mkdtemp(suffix=suffix, prefix=prefix)
try:
yield Path(tmp)
finally:
shutil.rmtree(tmp)
def tzaware_serie(ts):
return is_datetimetz(ts.index)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment