Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug when trying to get density #28

Merged
merged 4 commits into from
Mar 2, 2022
Merged

Fix bug when trying to get density #28

merged 4 commits into from
Mar 2, 2022

Conversation

pag1pag
Copy link

@pag1pag pag1pag commented Jan 31, 2022

When using d.get("CH4") or d.get(["CH4"]), it was not working.
By changing isinstance(xx, list) to isinstance(xx, str), it works.

@codecov
Copy link

codecov bot commented Jan 31, 2022

Codecov Report

Merging #28 (d5bd71b) into master (7ea6b3a) will not change coverage.
The diff coverage is 0.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #28   +/-   ##
=======================================
  Coverage   50.94%   50.94%           
=======================================
  Files          13       13           
  Lines         585      585           
=======================================
  Hits          298      298           
  Misses        287      287           
Impacted Files Coverage Δ
qtplaskin/modeldata.py 41.84% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7ea6b3a...d5bd71b. Read the comment docs.

@@ -483,7 +483,7 @@ def _index(s):
latest_i = min(d.shape[0] for d in
(self.raw_density, self.raw_rates, self.raw_conditions))

if isinstance(species, list):
if isinstance(species, str):
return self.raw_density[:latest_i, _index(species)]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pag1pag i think it should be

# at the beginning of the function : 
if isinstance(species, list):
        return [self.raw_density[:latest_i, _index(s)] for s in species]
return self.raw_density[:latest_i, _index(species)]

@erwanp erwanp added the bug label Jan 31, 2022
@erwanp erwanp merged commit c20a16f into erwanp:master Mar 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants