Skip to content

Commit

Permalink
Apply pre-commit hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
cphyc committed Apr 19, 2022
1 parent 1b3e3d7 commit 49ae220
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
14 changes: 9 additions & 5 deletions tangos/input_handlers/pynbody.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
from __future__ import absolute_import
from collections import defaultdict

import glob
import os
import os.path
import time
import weakref
import numpy as np
from collections import defaultdict
from itertools import chain

import numpy as np
from more_itertools import always_iterable

from ..util import proxy_object

pynbody = None # deferred import; occurs when a PynbodyInputHandler is constructed

from . import finding
from . import HandlerBase
from six.moves import range

from .. import config
from ..log import logger
from six.moves import range
from . import HandlerBase, finding

_loaded_halocats = {}

Expand Down Expand Up @@ -440,6 +442,7 @@ def _is_able_to_load(self, filepath):
class RamsesCatalogueMixin:
def create_bridge(self, f1, f2):
import pynbody

# Ensure that f1.dm and f2.dm are not garbage-collected
self._f1dm = f1.dm
self._f2dm = f2.dm
Expand Down Expand Up @@ -689,4 +692,5 @@ class ChangaUseIDLInputHandler(ChangaInputHandler):
auxiliary_file_patterns = ["*.amiga.grp"]

from . import caterpillar, eagle, ramsesHOP

RamsesHOPInputHandler = ramsesHOP.RamsesHOPInputHandler
12 changes: 7 additions & 5 deletions tangos/input_handlers/ramsesHOP.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
from more_itertools import always_iterable
from ..util import proxy_object
from itertools import chain
from .pynbody import PynbodyInputHandler, RamsesCatalogueMixin

import numpy as np
from ..log import logger
from more_itertools import always_iterable

from .. import config
from ..log import logger
from ..util import proxy_object
from .pynbody import PynbodyInputHandler, RamsesCatalogueMixin


class RamsesHOPInputHandler(RamsesCatalogueMixin, PynbodyInputHandler):
Expand Down Expand Up @@ -146,7 +148,7 @@ def iterate_object_properties_for_timestep(self, ts_extension, object_typetag, p
data = self._compute_contamination_fraction(adaptahop_halo)
else:
raise NotImplementedError(
"Cannot handle property %s for halo catalogue %r" % (
"Cannot handle property {} for halo catalogue {!r}".format(
k, self
)
)
Expand Down

0 comments on commit 49ae220

Please sign in to comment.