Commit c1196d7 1 parent 3bb42f3 commit c1196d7 Copy full SHA for c1196d7
File tree 4 files changed +2
-17
lines changed
workflow/src/legenddataflow
4 files changed +2
-17
lines changed Original file line number Diff line number Diff line change 1
- from datetime import datetime
2
1
from pathlib import Path
3
2
4
3
import yaml
16
15
17
16
def test_util ():
18
17
assert utils .tier_path (setup ) == str (testprod / "generated/tier" )
19
- time = datetime .now ()
20
- assert int (utils .unix_time (time .strftime ("%Y%m%dT%H%M%SZ" ))) == int (
21
- time .timestamp ()
22
- )
Original file line number Diff line number Diff line change 8
8
from itertools import product
9
9
from pathlib import Path
10
10
11
+ from dbetto .time import unix_time
12
+
11
13
from .patterns import (
12
14
full_channel_pattern_with_extension ,
13
15
get_pattern_tier ,
14
16
key_pattern ,
15
17
processing_pattern ,
16
18
)
17
- from .utils import unix_time
18
19
19
20
# key_pattern -> key
20
21
#
Original file line number Diff line number Diff line change 9
9
from .utils import (
10
10
subst_vars ,
11
11
subst_vars_in_snakemake_config ,
12
- unix_time ,
13
12
)
14
13
15
14
__all__ = [
23
22
"execenv_pyexe" ,
24
23
"subst_vars" ,
25
24
"subst_vars_in_snakemake_config" ,
26
- "unix_time" ,
27
25
]
Original file line number Diff line number Diff line change 9
9
import os
10
10
import re
11
11
import string
12
- from datetime import datetime
13
12
from pathlib import Path
14
13
15
14
# from dateutil import parser
@@ -189,14 +188,6 @@ def run_splitter(files):
189
188
return run_files
190
189
191
190
192
- def unix_time (value ):
193
- if isinstance (value , str ):
194
- return datetime .timestamp (datetime .strptime (value , "%Y%m%dT%H%M%SZ" ))
195
- else :
196
- msg = f"Can't convert type { type (value )} to unix time"
197
- raise ValueError (msg )
198
-
199
-
200
191
def set_last_rule_name (workflow , new_name ):
201
192
"""Sets the name of the most recently created rule to be `new_name`.
202
193
Useful when creating rules dynamically (i.e. unnamed).
You can’t perform that action at this time.
0 commit comments