Python interface improvements#74
Conversation
|
As discussed with @felixhekhorn we'll reserve |
|
Most of the functions of CLI consists mainly in printing tables, something we don't need for the python interface (since we can handle objects, and it is comfortable to do it), nevertheless we are wondering if it's worth to bind |
If you find that helpful I'd rather suggest to import the functionality into PineAPPL and remove the corresponding helper (and write a wrapper to the new function in PineAPPL). I'm definitely going to do that for the |
I would say just You can move yourself if you wish, or I can move it, but: where should I place? and how should I call it? (my guess would be to put it in |
My current idea is that instead of passing three functions ( |
|
Added syntactic sugar to get and set subgrids, but the The following code: import pineappl
g = pineappl.grid.Grid.read("dyaa.pineappl")
s = g[0, 0, 0]
g[0, 1, 0] = s(with Essentially the error is due to the subgrid not having been recast to any specific subgrid type when retrieved, so the |
Do |
Codecov Report
@@ Coverage Diff @@
## master #74 +/- ##
===========================================
+ Coverage 67.65% 77.69% +10.04%
===========================================
Files 13 14 +1
Lines 2226 2049 -177
===========================================
+ Hits 1506 1592 +86
+ Misses 720 457 -263
Continue to review full report at Codecov.
|
Ok, this might be a point. Nevertheless, I wonder if giving write access without read access is a good idea (about In case I can just revert and remove |
|
Instead I'm running in more serious troubles with We decided to keep Any suggestion? P.S.: |
That's a tough one, let me think about it. |
|
Mmm, I think the only solution (if we want to keep |
Yes, I agree this is how we should do it! |
Then I'm going to implement it immediately |
This commit also removes the use of `anyhow`, for which instead `thiserror` is used. Furthermore, it adds the method `Grid::write_lz4`, which writes a compressed grid. This method is used in the CLI whenever a file is written that has an extension 'lz4'.
|
The last item is implemented in commit dfdcdcc for the Rust API and in the CLI. Whenever you run |
|
@cschwan tested with |
|
Commit 714b559 should let you select a subset of orders in a |
|
@alecandido @felixhekhorn can we merge this? |
|
I reviewed just now, and the only thing I could spot is really the migration of Then let's merge, I would say. |
|
@alecandido @felixhekhorn do you need another release for the Python interface to be uploaded? If so, I'm going to release it as |
|
Yes, that would be nice. Then I'm going to update dependencies in runcards, pineko. and yadism. |
|
Not necessarily, but a release would make things easier and since the last we added several new features ... |
|
I believe there is no official way of naming alpha, beta, and release_candidate (for sure it's not specified in semver). Just be consistent with one scheme. |
|
Yes, as far as semver is concerned both are OK (I think). |
|
Ok, I just checked and the answer is definitely yes:
https://semver.org/#spec-item-9 or even more: @cschwan is more correct then poetry, that is not using the dash (but even the official CPython is omitting the dash...) |
|
@alecandido I released v0.5.0-beta.2, but building the documentation fails and I can't reproduce the error: https://readthedocs.org/projects/pineappl/builds/15107369/ |
|
Sorry not to have replied before, I'm glad that you already solved the issue! |
While working on stuffs that make use of python interface, new needs arose. Thus, there is room to add some improvements.
Following a list of possible ones:
Grid.key_values()method see Run scripts with python pinecards#104 (comment)a function close tomergesubcommand see Run scripts with python pinecards#104 (comment)movemoved to Fixpineappl_cli::helpers::convolute()in main crateGrid::convolutecaching strategy #66helpers::convolute()Grid::write_lz4method #80