Skip to content

Commit

Permalink
Use zlib.
Browse files Browse the repository at this point in the history
  • Loading branch information
robertdstein committed May 10, 2020
1 parent f3b0246 commit d121ff1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion flarestack/utils/prepare_catalogue.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import os
import logging
import random
import zlib
from flarestack.shared import catalogue_dir

cat_dtype = [
Expand Down Expand Up @@ -52,7 +53,7 @@ def build_ps_cat_name(sindec):
+ ".npy"

def build_ps_stack_cat_name(sindecs):
return f"{catalogue_dir}multi_source/{hash(str(sindecs))}.npy"
return f"{catalogue_dir}multi_source/{zlib.adler32(str(list(sindecs)).encode())}.npy"

def make_single_source(sindec):
cat = single_source(sindec)
Expand Down

0 comments on commit d121ff1

Please sign in to comment.