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

#1554 fix indexing for FEM entries #1556

Merged
merged 4 commits into from
Jul 21, 2021
Merged

Conversation

rtimms
Copy link
Contributor

@rtimms rtimms commented Jul 20, 2021

Description

Fixes the order of the indexing for the entries of variables solved using FEM

Fixes #1554

Type of change

Please add a line in the relevant section of CHANGELOG.md to document the change (include PR #) - note reverse order of PR #s. If necessary, also add to the list of breaking changes.

  • New feature (non-breaking change which adds functionality)
  • Optimization (back-end change that speeds up the code)
  • Bug fix (non-breaking change which fixes an issue)

Key checklist:

  • No style issues: $ flake8
  • All tests pass: $ python run-tests.py --unit
  • The documentation builds: $ cd docs and then $ make clean; make html

You can run all three at once, using $ python run-tests.py --quick.

Further checks:

  • Code is commented, particularly in hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

@codecov
Copy link

codecov bot commented Jul 20, 2021

Codecov Report

Merging #1556 (7d611b5) into develop (002ad15) will increase coverage by 0.50%.
The diff coverage is n/a.

❗ Current head 7d611b5 differs from pull request most recent head 7b4905d. Consider uploading reports for the commit 7b4905d to get more accurate results
Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1556      +/-   ##
===========================================
+ Coverage    97.77%   98.28%   +0.50%     
===========================================
  Files          242      310      +68     
  Lines        12639    17398    +4759     
===========================================
+ Hits         12358    17099    +4741     
- Misses         281      299      +18     
Impacted Files Coverage Δ
pybamm/__init__.py 94.95% <ø> (ø)
pybamm/batch_study.py 100.00% <ø> (ø)
pybamm/citations.py 100.00% <ø> (ø)
pybamm/discretisations/discretisation.py 99.78% <ø> (+<0.01%) ⬆️
pybamm/experiments/experiment.py 100.00% <ø> (+1.81%) ⬆️
pybamm/expression_tree/array.py 100.00% <ø> (ø)
pybamm/expression_tree/binary_operators.py 99.67% <ø> (+4.71%) ⬆️
pybamm/expression_tree/broadcasts.py 100.00% <ø> (ø)
pybamm/expression_tree/concatenations.py 98.13% <ø> (+0.68%) ⬆️
pybamm/expression_tree/exceptions.py 100.00% <ø> (ø)
... and 322 more

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 e21d2da...7b4905d. Read the comment docs.

Copy link
Sponsor Member

@brosaplanella brosaplanella left a comment

Choose a reason for hiding this comment

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

Looks good, thanks Rob! Just see my comment on the commented line.

@@ -429,6 +429,7 @@ def test_plot_2plus1D_spm(self):
quick_plot.slider_update(1)

# check 2D (y,z space) variables update properly for different time units
# Note: these should be the transpose of the entries in the processed variable
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

I am confused: the comment says it should be the transpose but below it is not transposed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the test we do, e.g., np.testing.assert_array_almost_equal(qp_data.T, phi_n[:, :, 0]) so that qp_data is transposed

@rtimms rtimms merged commit 396c9ef into develop Jul 21, 2021
@rtimms rtimms deleted the issue-1554-2D-processed-var branch July 21, 2021 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dimensions interchanged in 2D processed variable
2 participants