Skip to content

Commit

Permalink
Merge pull request #117 from Adnan-Ali-Ahmad/vaytet_osyris
Browse files Browse the repository at this point in the history
Fix pint import error
  • Loading branch information
nvaytet authored Jun 12, 2023
2 parents 4ded389 + b01bd0e commit 088209d
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/osyris/core/array.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2022 Osyris contributors (https://github.com/osyris-project/osyris)
import numpy as np
from pint.quantity import Quantity
from pint import Quantity
from pint.errors import DimensionalityError
from .base import Base
from .tools import value_to_string
Expand Down
2 changes: 1 addition & 1 deletion src/osyris/core/vector.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2022 Osyris contributors (https://github.com/osyris-project/osyris)
import numpy as np
from pint.quantity import Quantity
from pint import Quantity
from .base import Base
from .array import Array
from .tools import value_to_string
Expand Down
2 changes: 1 addition & 1 deletion src/osyris/plot/histogram2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright (c) 2022 Osyris contributors (https://github.com/osyris-project/osyris)

import numpy as np
from pint.quantity import Quantity
from pint import Quantity
from typing import Union
from ..core import Array, Plot
from .render import render
Expand Down
2 changes: 1 addition & 1 deletion src/osyris/plot/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import numpy as np
import numpy.ma as ma
from pint.quantity import Quantity
from pint import Quantity
from typing import Union
from .direction import get_direction
from .render import render
Expand Down
2 changes: 1 addition & 1 deletion src/osyris/plot/scatter.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2022 Osyris contributors (https://github.com/osyris-project/osyris)

from pint.quantity import Quantity
from pint import Quantity
from ..core import Plot, Array
from .. import units
from .render import render
Expand Down
4 changes: 2 additions & 2 deletions src/osyris/plot/wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from matplotlib.cm import ScalarMappable
from matplotlib.collections import PatchCollection
import numpy as np
from pint.quantity import Quantity
from pint import Quantity


def _add_colorbar(obj, ax, cax=None, label=None):
Expand Down Expand Up @@ -41,7 +41,7 @@ def quiver(ax,
default_args = {"angles": "xy", "pivot": "mid", "zorder": zorder}
default_args.update(kwargs)

skips = np.around(np.array(z.shape) * 4.0 / 128.0 / density).astype(np.int)
skips = np.around(np.array(z.shape) * 4.0 / 128.0 / density).astype(int)
skip = (slice(None, None, skips[0]), slice(None, None, skips[1]))

args = [x[skip[0]], y[skip[1]], z[..., 0][skip], z[..., 1][skip]]
Expand Down

0 comments on commit 088209d

Please sign in to comment.