Skip to content

Commit

Permalink
sty: run isort -rc .
Browse files Browse the repository at this point in the history
  • Loading branch information
neutrinoceros committed Jul 2, 2020
1 parent b8a2c62 commit f2eb8a3
Show file tree
Hide file tree
Showing 541 changed files with 3,431 additions and 4,225 deletions.
1 change: 0 additions & 1 deletion conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
from yt.config import ytcfg
from yt.utilities.answer_testing import utils


# Global variables can be added to the pytest namespace
answer_files = {}

Expand Down
8 changes: 6 additions & 2 deletions scripts/iyt
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
#!python
from __future__ import print_function

import os
import re
from yt.mods import *

from IPython.terminal.interactiveshell import TerminalInteractiveShell

from yt.data_objects.data_containers import YTDataContainer
from yt.mods import *

namespace = locals().copy()
namespace.pop("__builtins__", None)

Expand All @@ -24,7 +29,6 @@ except ImportError:
code.interact(doc, None, namespace)
sys.exit()

from IPython.terminal.interactiveshell import TerminalInteractiveShell
ip_shell = TerminalInteractiveShell(user_ns=namespace, banner1 = doc,
display_banner = True)
if "DISPLAY" in os.environ:
Expand Down
5 changes: 3 additions & 2 deletions scripts/pr_backport.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import shutil
import tempfile

import dateutil.parser
import git
import requests
import shutil
import tempfile

API_URL = 'https://api.github.com/graphql'

Expand Down
27 changes: 15 additions & 12 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
import glob
import os
import platform
from concurrent.futures import ThreadPoolExecutor as Pool
import glob
import sys
from concurrent.futures import ThreadPoolExecutor as Pool
from distutils.ccompiler import CCompiler
from distutils.version import LooseVersion
from sys import platform as _platform
from setuptools import setup, find_packages
from setuptools.extension import Extension

import pkg_resources
from setuptools import find_packages, setup
from setuptools.command.build_ext import build_ext as _build_ext
from setuptools.command.sdist import sdist as _sdist
from setupext import \
check_for_openmp, \
check_for_pyembree, \
read_embree_location, \
in_conda_env
from distutils.version import LooseVersion
from distutils.ccompiler import CCompiler
import pkg_resources
from setuptools.extension import Extension

from setupext import (
check_for_openmp,
check_for_pyembree,
in_conda_env,
read_embree_location,
)


def _get_cpu_count():
Expand Down
7 changes: 3 additions & 4 deletions setupext.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@
import subprocess
import sys
import tempfile

from distutils import log
from distutils.ccompiler import new_compiler
from distutils.sysconfig import customize_compiler
from distutils.errors import CompileError, LinkError
from pkg_resources import resource_filename
from subprocess import Popen, PIPE
from distutils.sysconfig import customize_compiler
from subprocess import PIPE, Popen

from pkg_resources import resource_filename

CCODE = """
#include <omp.h>
Expand Down
18 changes: 10 additions & 8 deletions tests/nose_runner.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
import sys
import os
import yaml
import multiprocessing
import nose
import os
import sys
from io import StringIO

import nose
import numpy
import yaml
from coverage import Coverage

from yt.config import ytcfg
from yt.utilities.answer_testing.framework import AnswerTesting

cov = Coverage(config_file=".coveragerc", branch=True, auto_data=True,
concurrency="multiprocessing")
cov.start()

from io import StringIO
from yt.config import ytcfg
from yt.utilities.answer_testing.framework import AnswerTesting
import numpy
numpy.set_printoptions(threshold=5, edgeitems=1, precision=4)

class NoseWorker(multiprocessing.Process):
Expand Down
1 change: 1 addition & 0 deletions tests/report_failed_answers.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import nose
import numpy
import requests

from yt.config import ytcfg
from yt.utilities.answer_testing.framework import AnswerTesting
from yt.utilities.command_line import FileStreamer
Expand Down
3 changes: 1 addition & 2 deletions yt/analysis_modules/absorption_spectrum/api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from yt.utilities.exceptions import \
YTModuleRemoved
from yt.utilities.exceptions import YTModuleRemoved

raise YTModuleRemoved(
"AbsorptionSpectrum",
Expand Down
3 changes: 1 addition & 2 deletions yt/analysis_modules/cosmological_observation/api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from yt.utilities.exceptions import \
YTModuleRemoved
from yt.utilities.exceptions import YTModuleRemoved

raise YTModuleRemoved(
"CosmologySplice and LightCone",
Expand Down
3 changes: 1 addition & 2 deletions yt/analysis_modules/halo_analysis/api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from yt.utilities.exceptions import \
YTModuleRemoved
from yt.utilities.exceptions import YTModuleRemoved

raise YTModuleRemoved(
"halo_analysis",
Expand Down
3 changes: 1 addition & 2 deletions yt/analysis_modules/halo_finding/api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from yt.utilities.exceptions import \
YTModuleRemoved
from yt.utilities.exceptions import YTModuleRemoved

raise YTModuleRemoved(
"halo_finding",
Expand Down
3 changes: 1 addition & 2 deletions yt/analysis_modules/halo_mass_function/api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from yt.utilities.exceptions import \
YTModuleRemoved
from yt.utilities.exceptions import YTModuleRemoved

raise YTModuleRemoved(
"halo_mass_function",
Expand Down
3 changes: 1 addition & 2 deletions yt/analysis_modules/photon_simulator/api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from yt.utilities.exceptions import \
YTModuleRemoved
from yt.utilities.exceptions import YTModuleRemoved

raise YTModuleRemoved(
"photon_simulator",
Expand Down
3 changes: 1 addition & 2 deletions yt/analysis_modules/ppv_cube/api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from yt.utilities.exceptions import \
YTModuleRemoved
from yt.utilities.exceptions import YTModuleRemoved

raise YTModuleRemoved(
"PPVCube",
Expand Down
3 changes: 1 addition & 2 deletions yt/analysis_modules/radmc3d_export/api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from yt.utilities.exceptions import \
YTModuleRemoved
from yt.utilities.exceptions import YTModuleRemoved

raise YTModuleRemoved(
"radmc3d_export",
Expand Down
3 changes: 1 addition & 2 deletions yt/analysis_modules/star_analysis/api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from yt.utilities.exceptions import \
YTModuleRemoved
from yt.utilities.exceptions import YTModuleRemoved

raise YTModuleRemoved(
"star_analysis",
Expand Down
3 changes: 1 addition & 2 deletions yt/analysis_modules/sunrise_export/api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from yt.utilities.exceptions import \
YTModuleRemoved
from yt.utilities.exceptions import YTModuleRemoved

raise YTModuleRemoved(
"sunrise_export",
Expand Down
3 changes: 1 addition & 2 deletions yt/analysis_modules/sunyaev_zeldovich/api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from yt.utilities.exceptions import \
YTModuleRemoved
from yt.utilities.exceptions import YTModuleRemoved

raise YTModuleRemoved(
"sunyaev_zeldovich",
Expand Down
3 changes: 1 addition & 2 deletions yt/analysis_modules/two_point_functions/api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from yt.utilities.exceptions import \
YTModuleRemoved
from yt.utilities.exceptions import YTModuleRemoved

raise YTModuleRemoved(
"two_point_functions",
Expand Down
1 change: 0 additions & 1 deletion yt/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@
"""

2 changes: 1 addition & 1 deletion yt/config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import configparser
import os
import warnings
import configparser

ytcfg_defaults = dict(
serialize = 'False',
Expand Down
14 changes: 7 additions & 7 deletions yt/convenience.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
# Named imports
from yt.config import ytcfg
from yt.funcs import mylog
from yt.utilities.parameter_file_storage import \
output_type_registry, \
simulation_time_series_registry, \
EnzoRunDatabase
from yt.utilities.exceptions import \
YTOutputNotIdentified, \
YTSimulationNotIdentified
from yt.utilities.exceptions import YTOutputNotIdentified, YTSimulationNotIdentified
from yt.utilities.hierarchy_inspection import find_lowest_subclasses
from yt.utilities.parameter_file_storage import (
EnzoRunDatabase,
output_type_registry,
simulation_time_series_registry,
)


def _sanitize_load_args(*args):
"""Filter out non-pathlike arguments, ensure list form, and expand '~' tokens"""
Expand Down
45 changes: 10 additions & 35 deletions yt/data_objects/api.py
Original file line number Diff line number Diff line change
@@ -1,35 +1,10 @@
from .grid_patch import \
AMRGridPatch

from .octree_subset import \
OctreeSubset

from .static_output import \
Dataset

from .profiles import \
create_profile, \
Profile1D, \
Profile2D, \
Profile3D, \
ParticleProfile

from .time_series import \
DatasetSeries, \
DatasetSeriesObject

from .analyzer_objects import \
AnalysisTask, analysis_task

from .data_containers import \
data_object_registry

from . import construction_data_containers as __cdc
from . import selection_data_containers as __sdc

from .image_array import \
ImageArray

from .particle_filters import \
particle_filter, \
add_particle_filter
from . import construction_data_containers as __cdc, selection_data_containers as __sdc
from .analyzer_objects import AnalysisTask, analysis_task
from .data_containers import data_object_registry
from .grid_patch import AMRGridPatch
from .image_array import ImageArray
from .octree_subset import OctreeSubset
from .particle_filters import add_particle_filter, particle_filter
from .profiles import ParticleProfile, Profile1D, Profile2D, Profile3D, create_profile
from .static_output import Dataset
from .time_series import DatasetSeries, DatasetSeriesObject
Loading

0 comments on commit f2eb8a3

Please sign in to comment.