Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ htmlcov
*.rtin
*.rtout
build_cmake
.vscode
dist
Hyperion.egg-info

2 changes: 1 addition & 1 deletion hyperion/conf/conf_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import warnings
import numpy as np
from astropy import log as logger
from astropy.extern import six
import six

from ..util.functions import FreezableClass, bool2str, str2bool, is_numpy_array
from ..filter import Filter
Expand Down
2 changes: 1 addition & 1 deletion hyperion/densities/alpha_disk.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import numpy as np
from astropy import log as logger
from astropy.extern import six
import six

from ..dust import SphericalDust
from ..util.constants import pi, G
Expand Down
2 changes: 1 addition & 1 deletion hyperion/densities/ambient_medium.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import print_function, division

import numpy as np
from astropy.extern import six
import six

from ..dust import SphericalDust
from ..grid import SphericalPolarGrid
Expand Down
2 changes: 1 addition & 1 deletion hyperion/densities/bipolar_cavity.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import numpy as np
from astropy import log as logger
from astropy.extern import six
import six

from ..util.functions import FreezableClass
from ..dust import SphericalDust
Expand Down
2 changes: 1 addition & 1 deletion hyperion/densities/flared_disk.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import numpy as np
from astropy import log as logger
from astropy.extern import six
import six

from ..dust import SphericalDust
from ..util.constants import pi
Expand Down
2 changes: 1 addition & 1 deletion hyperion/densities/power_law_envelope.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import numpy as np
from astropy import log as logger
from astropy.extern import six
import six

from ..dust import SphericalDust
from ..grid import SphericalPolarGrid, CylindricalPolarGrid
Expand Down
2 changes: 1 addition & 1 deletion hyperion/densities/ulrich_envelope.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import numpy as np
from astropy import log as logger
from astropy.extern import six
import six

from ..dust import SphericalDust
from ..grid import SphericalPolarGrid, CylindricalPolarGrid
Expand Down
2 changes: 1 addition & 1 deletion hyperion/dust/dust_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import h5py
import numpy as np
from astropy import log as logger
from astropy.extern import six
import six

from ..version import __version__

Expand Down
2 changes: 1 addition & 1 deletion hyperion/filter/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import numpy as np

from astropy.extern import six
import six
from astropy import units as u

from ..util.integrate import integrate
Expand Down
2 changes: 1 addition & 1 deletion hyperion/grid/tests/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import h5py
import numpy as np
import pytest
from astropy.extern import six
import six

from ...util.functions import random_id
from .. import (CartesianGrid,
Expand Down
2 changes: 1 addition & 1 deletion hyperion/grid/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import numpy as np
import pytest
from astropy.extern import six
import six

from hyperion.grid import CartesianGrid, CylindricalPolarGrid, SphericalPolarGrid, AMRGrid, OctreeGrid

Expand Down
2 changes: 1 addition & 1 deletion hyperion/grid/yt3_wrappers.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import print_function, division

import numpy as np
from astropy.extern import six
import six
from astropy import log as logger


Expand Down
2 changes: 1 addition & 1 deletion hyperion/importers/orion.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import numpy as np

from astropy import log as logger
from astropy.extern import six
import six

from ..grid.amr_grid import Grid, Level, AMRGrid

Expand Down
2 changes: 1 addition & 1 deletion hyperion/model/image.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np

from astropy.extern import six
import six

from ..util.functions import FreezableClass, is_numpy_array
from ..util.constants import c
Expand Down
2 changes: 1 addition & 1 deletion hyperion/model/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import numpy as np

from astropy import log as logger
from astropy.extern import six
import six

from ..version import __version__
from ..util.functions import delete_file
Expand Down
2 changes: 1 addition & 1 deletion hyperion/model/model_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import numpy as np
from astropy import log as logger
from astropy.extern import six
import six

from ..util.constants import c, pi
from ..util.functions import FreezableClass
Expand Down
2 changes: 1 addition & 1 deletion hyperion/model/sed.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np

from astropy.extern import six
import six

from ..util.functions import FreezableClass
from ..util.constants import c
Expand Down
8 changes: 5 additions & 3 deletions hyperion/model/tests/test_bit_level.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@
import shutil
import itertools

import pytest
try:
import pytest
except:
from astropy.tests.helper import pytest
import numpy as np

from astropy.extern.six import StringIO
from six import StringIO
from .test_helpers import random_id, assert_identical_results
from .. import Model, AnalyticalYSOModel
from ...util.constants import pc, lsun, c, au, msun, pi, sigma, rsun
Expand All @@ -25,7 +28,6 @@

bit_level = pytest.mark.skipif(str(not pytest.config.getoption('enable_bit_level_tests')))


@pytest.fixture(scope="module")
def generate(request):
generate_reference = request.config.getvalue("generate_reference")
Expand Down
2 changes: 1 addition & 1 deletion hyperion/model/tests/test_sed.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from numpy.testing import assert_array_almost_equal_nulp

import pytest
from astropy.extern import six
import six

from .. import Model
from ..sed import SED
Expand Down
2 changes: 1 addition & 1 deletion hyperion/util/tests/test_integrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from numpy.testing import assert_array_almost_equal_nulp

import pytest
from astropy.extern import six
import six

from ..integrate import *

Expand Down
2 changes: 1 addition & 1 deletion hyperion/util/validator.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import numpy as np

from astropy import units as u
from astropy.extern import six
import six


def validate_physical_type(name, value, physical_type):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,6 @@ def run(self):
cmdclass=cmdclass,
ext_modules=ext_modules,
setup_requires=['numpy>=1.11'],
install_requires=['numpy>=1.11', 'matplotlib>=1.5', 'astropy>=1.2', 'h5py>=2.4', 'yt>=3.2'],
install_requires=['numpy>=1.11', 'matplotlib>=1.5', 'astropy>=1.2', 'h5py>=2.4', 'yt>=3.2', 'six'],
extras_require={'test': ['pytest'],
'docs': ['sphinx', 'numpydoc']})
7 changes: 5 additions & 2 deletions src/dust/dust_interact.f90
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ subroutine interact(p, force_scatter)
real(dp) :: xi,albedo
real(dp) :: energy_scaling
logical,optional :: force_scatter
logical :: force_scatter_val = .false.

if(present(force_scatter)) force_scatter_val = force_scatter

! given the density and energy of each dust type, process a photon
! this means finding out whether to scatter or aborb the photon, and to do
! whatever needs doing
Expand All @@ -43,7 +46,7 @@ subroutine interact(p, force_scatter)
p%s_prev = p%s

! Decide whether to absorb or scatter
if(present(force_scatter) .and. force_scatter) then
if(force_scatter_val) then
xi = 0._dp
else
call random(xi)
Expand All @@ -69,7 +72,7 @@ subroutine interact(p, force_scatter)

call angle3d_to_vector3d(p%a,p%v)

if(present(force_scatter) .and. force_scatter) then
if(force_scatter_val) then
p%energy = p%energy * albedo
end if

Expand Down
2 changes: 1 addition & 1 deletion src/grid/grid_physics_3d.f90
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ logical function specific_energy_converged() result(converged)

write(*,*)
write(*,'(" -> Percentile: ",F7.2)') convergence_percentile
write(*,'(" -> Value @ Percentile: ",F10.2)') value
write(*,'(" -> Value @ Percentile: ",E10.3)') value
if(value_prev < huge(1._dp)) then
if(value == 0._dp) then
write(*,'(" -> Exact convergence")')
Expand Down