Skip to content

Commit

Permalink
replace np.nan with math.isnan()
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurDeclercq committed Aug 2, 2023
1 parent 8350f7b commit 3d45fee
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ms2rescore/feature_generators/ms2pip.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import warnings
from itertools import chain
from typing import List, Optional, Union
import math

import numpy as np
import pandas as pd
Expand Down Expand Up @@ -303,7 +304,7 @@ def _calculate_features_single(self, processing_result: ProcessingResult) -> Uni
features = dict(
zip(
self.feature_names,
[0.0 if ft is np.nan else ft for ft in feature_values],
[0.0 if math.isnan(ft) else ft for ft in feature_values],
)
)

Expand Down

0 comments on commit 3d45fee

Please sign in to comment.