[
https://issues.apache.org/jira/browse/CLIMATE-88?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13679661#comment-13679661
]
Alex Goodman commented on CLIMATE-88:
-------------------------------------
Hi Kyo,
I am not sure if this is the best approach. resize() will modify the array in
place so this would solve the performance problem of making unnecessary copies
(eg via reshape()) but this also would mean I would have to manually reset the
shape of the input array after doing the calculations. Thus it is still
necessary to make a view (shallow copy) of the input array before reshaping
since this would keep the original shape unaltered. I could however change just
this line in reshapeMonthlyData():
data.shape = tuple(list(nshape) + list(ishape[1:]))
to:
data.resize(tuple(list(nshape) + list(ishape[1:])))
Does anyone else have a preference?
> Performance improvements for metrics.py
> ---------------------------------------
>
> Key: CLIMATE-88
> URL: https://issues.apache.org/jira/browse/CLIMATE-88
> Project: Apache Open Climate Workbench
> Issue Type: Improvement
> Components: metrics
> Affects Versions: 0.1-incubating
> Reporter: Alex Goodman
> Assignee: Chris A. Mattmann
> Fix For: 0.1-incubating
>
> Attachments: benchmark_metrics.py,
> benchmark_metrics_with_resize_method.py
>
>
> The performance for many of the functions in metrics.py can be improved by
> removing some unnecessary loops and utilizing shape manipulation.
> I have attached some example code that benchmarks the differences between the
> original and proposed methodology if you did not see it in the mailing list.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira