Skip to content

Commit

Permalink
Solving linting issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
ndilalla committed Oct 31, 2023
1 parent d764c50 commit 5fa9a44
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion astromodels/core/property.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def to_dict(self, minimal=False) -> Dict[str, Any]:
# In the complete representation we output everything is needed to re-build the object

data["value"] = (
self.value if type(self.value) == bool else str(self.value)
self.value if type(self.value) is bool else str(self.value)
)
data["desc"] = str(self._desc)
data["allowed values"] = self._to_python_type(self._allowed_values)
Expand Down
4 changes: 2 additions & 2 deletions astromodels/functions/function.py
Original file line number Diff line number Diff line change
Expand Up @@ -1678,7 +1678,7 @@ def __call__(self, x, y, *args, **kwargs):
# which is not an array into an array introduce a significant overload (10 microseconds or so), so we perform
# this transformation only when strictly required

assert type(x) == type(y), "You have to use the same type for x and y"
assert type(x) is type(y), "You have to use the same type for x and y"

if isinstance(x, np.ndarray):

Expand Down Expand Up @@ -1847,7 +1847,7 @@ def __call__(self, x, y, z):
# which is not an array into an array introduce a significant overload (10 microseconds or so), so we perform
# this transformation only when strictly required

assert type(x) == type(y) and type(y) == type(
assert type(x) is type(y) and type(y) is type(
z
), "You have to use the same type for x, y and z"

Expand Down
2 changes: 1 addition & 1 deletion astromodels/sources/extended_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def __call__(self, lon, lat, energies):
:return: differential flux at given position and energy
"""

assert type(lat) == type(lon) and type(lon) == type(
assert type(lat) is type(lon) and type(lon) is type(
energies
), "Type mismatch in input of call"

Expand Down
2 changes: 1 addition & 1 deletion astromodels/utils/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def recurse_dict(d, tree):

for k, v in d.items():

if (type(v) == dict) or isinstance(v, DictConfig):
if (type(v) is dict) or isinstance(v, DictConfig):

branch = tree.add(
k, guide_style="bold medium_orchid", style="bold medium_orchid"
Expand Down

0 comments on commit 5fa9a44

Please sign in to comment.