Changing it to [:4] worked ([:8] did not).

From: Tom Aldcroft [mailto:notifications@github.com]
Sent: Tuesday, April 02, 2013 11:17 AM
To: sot/taco
Cc: Mark Baski
Subject: Re: [taco] Add mechanism to make calc_earth_vis() reproducible by default (#3)


In Chandra.taco/Chandra/taco/taco.py:

> +    global _RANDOM_SALT

> +    _RANDOM_SALT = salt

> +

> +

> +def _make_reproducible(func):

> +    @functools.wraps(func)

> +    def wrapper(*args, **kwargs):

> +        if _RANDOM_SALT is not None:

> +            md5 = hashlib.md5()

> +            md5.update(repr(_RANDOM_SALT))

> +            for val in args:

> +                md5.update(repr(val))

> +            for val in kwargs.values():

> +                md5.update(repr(val))

> +            digest = md5.hexdigest()

> +            seed = int(digest[:12], 16)

@mbaski<https://github.com/mbaski> - Try changing the [:12] to [:8] or even [:4]. I suspect the problem might be a bits issue, I got a similar error to yours before putting in the [:12].

—
Reply to this email directly or view it on GitHub<https://github.com/sot/taco/pull/3/files#r3619696>.