Skip to content

Optimize#28

Merged
danlipsa merged 5 commits intoKitware:masterfrom
danlipsa:optimize
Mar 19, 2026
Merged

Optimize#28
danlipsa merged 5 commits intoKitware:masterfrom
danlipsa:optimize

Conversation

@danlipsa
Copy link
Collaborator

No description provided.

@danlipsa
Copy link
Collaborator Author

@jourdain Please review

@jourdain
Copy link
Collaborator

Can you follow https://www.conventionalcommits.org/en/v1.0.0/ for your commit message. That way, the changelog and updated version on PyPI/conda will reflect your work.

If you don't mind not keeping your separate commits, I can squash them using a correct syntax from the web UI. Just let me know.

@jourdain
Copy link
Collaborator

Otherwise your changes seems reasonable.

@danlipsa
Copy link
Collaborator Author

How does this look now? By the way, EAMExtract will need to be changed as well to work with centering other than 0 (what works now). I'll do that in my next cycle of work on this project starting on Mo.

@jourdain
Copy link
Collaborator

commit messages looks great! Thanks

@jourdain
Copy link
Collaborator

Should I merge?

@jourdain
Copy link
Collaborator

I'm guessing your fixes with ! is to denote a breaking change, right?

@danlipsa
Copy link
Collaborator Author

I'm guessing your fixes with ! is to denote a breaking change, right?

Yes.

@danlipsa danlipsa merged commit 676fb43 into Kitware:master Mar 19, 2026
1 check passed
@jourdain
Copy link
Collaborator

FYI and myself

ERROR:root:Exception raised by task = <Task finished name='Task-49' coro=<EAMApp._data_load_variables() done, defined at /Users/sebastien.jourdain/miniconda3/envs/quickview/lib/python3.13/site-packages/e3sm_quickview/app.py:455> exception=IndexError('boolean index did not match indexed array along axis 0; size of axis is 21600 but size of corresponding boolean axis is 21840')>
Traceback (most recent call last):
  File "/Users/sebastien.jourdain/miniconda3/envs/quickview/lib/python3.13/site-packages/trame_common/exec/asynchronous.py", line 14, in handle_task_result
    task.result()
    ~~~~~~~~~~~^^
  File "/Users/sebastien.jourdain/miniconda3/envs/quickview/lib/python3.13/site-packages/e3sm_quickview/app.py", line 478, in _data_load_variables
    with self.state:
         ^^^^^^^^^^
  File "/Users/sebastien.jourdain/miniconda3/envs/quickview/lib/python3.13/site-packages/trame_server/state.py", line 333, in __exit__
    self.flush()
    ~~~~~~~~~~^^
  File "/Users/sebastien.jourdain/miniconda3/envs/quickview/lib/python3.13/site-packages/trame_server/state.py", line 311, in flush
    coroutine = callback(**self._pushed_state)
  File "/Users/sebastien.jourdain/miniconda3/envs/quickview/lib/python3.13/site-packages/e3sm_quickview/app.py", line 574, in _on_downstream_change
    self.state.fields_avgs = compute.extract_avgs(
                             ~~~~~~~~~~~~~~~~~~~~^
        data, self.selected_variable_names
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/Users/sebastien.jourdain/miniconda3/envs/quickview/lib/python3.13/site-packages/e3sm_quickview/utils/compute.py", line 46, in extract_avgs
    avg_value = calculate_weighted_average(vtk_array, area_array)
  File "/Users/sebastien.jourdain/miniconda3/envs/quickview/lib/python3.13/site-packages/e3sm_quickview/utils/compute.py", line 28, in calculate_weighted_average
    weights = weights[mask]
              ~~~~~~~^^^^^^
IndexError: boolean index did not match indexed array along axis 0; size of axis is 21600 but size of corresponding boolean axis is 21840

@jourdain
Copy link
Collaborator

That line is the failing one
https://github.com/Kitware/QuickView/blob/master/src/e3sm_quickview/utils/compute.py#L46

@danlipsa maybe you may have a quick idea why this is failing?

@jourdain
Copy link
Collaborator

@willdunklin If I replace that line with a continue that skip the issue and get things working. But we are missing the avg...

@danlipsa
Copy link
Collaborator Author

Seems like an array that is read is not processed through the clip (it has fewer cells). I'll take a look, and try to reproduce it. Is that on master?

@danlipsa
Copy link
Collaborator Author

@jourdain Does this fix it? #29

@jourdain
Copy link
Collaborator

yes it does, thx

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.

2 participants