Comments (13)
Thank you for weighing in.
I don't have much to add, the situation is quite clear: a big refactoring of the API would be (probably) the best option, but it's risky. A small incremental step is safer, but we may piss off the users by changing the API too often.
As I see it the main part of the API change which the users must relate to is the moving-files-around which is original topic of this issue. When that is settled I (at least) have thought the main API changes will be the addition of leaner-simpler-to-use API; the current classes will (mainly) still be available - at least the part which sees most use.
[...] but I was wondering, who are the main users (or, the people who'd be mainly affected by this change)?
The users I worry about are general reservoir engineers in Statoil who write scripts, and the people using those scripts again. If it were only "us" I would not be such a PITA regarding these questions.
from resdata.
This is very good - possible suggestions:
-
I would make a
ecl/file
which could contain theecl_file, ecl_file_view, ecl_init_file, fortio
andecl_restart_file
modules. -
The
schedule
files should have been inlibres
. -
ecl_kw
should be in theecl/
root. -
.....
from resdata.
Thanks, the only objection I have to ecl/file
is that file
is a Python builtin so when you from ecl import file
you will overwrite the file
Python class. What about ecl/eclfile
?
Other than that, very good ideas that we should implement.
from resdata.
What about ecl/eclfile?
Good - idea.
from resdata.
The only question I have now is whether we should try to have fewer rather than more submodules.
from resdata.
ecl
├── ecl_kw.py
├── ecl_type.py
├── ecl_util.py
├── eclfile/
├── fault/
├── well/
├── gravimetry/
├── grid/
├── rft/
├── summary/
├── util
|── test/
├── geometry/
├── util/
I would like to kick this discussion back to life. Compared to @pgdr suggestion above I have made two changes:
- The individual modules in the various subpackages like
ecl.grid
andecl.summary
are not shown; that is purely to increase readability. test
,geometry
andutil
subpackages are all assembled underecl.util
- that way everything which is not strictly related to Eclipse files is assembled in one location; hopefully it will be simpler chip off parts from this part of the library this way.
When we have agreed on this - or something like it - we can also add function based shortcuts as alternatives to explicit class instantiation in the root package?
from resdata.
The reason I stopped thinking about this was because I realized we need more than simply moving the files around; we need a major rethinking of the API.
The first smell we need to address, and to me the most important, is that users have to import too many symbols and use too many constructors to get the data they want. I dislike UML with a passion, but I believe that this project would benefit greatly from sketching up a class diagram so that we can clearly see how elements are interconnected.
The second issue I think we should address before going on with PIP packaging ecl is to remove as much from util as possible, and remove test in its entirety.
And third, I would like us to go through every single symbol we expose and see if we can't make it private, or even remove it.
from resdata.
The reason I stopped thinking about this was because I realized we need more than simply moving the files around; we need a major rethinking of the API.
Thank you for contributing further to the discussion. I agree - more or less - with many of your points; but I do not agree with the ordering. I would very much like to perform (a variant of) the suggested reorganization now, and then gradually address the other points you raise. The reason I want to do moving-files-around first is twofold:
-
I really want to deprecate the
ert.xxx
packages mainted in theert_legacy
directory, to achieve that I think we should go through a period of deprecation where theert.ecl.xxx
modules "redirect" to the correct new location - with a solid warning. Currently theert.ecl.xxx
module is just relocated toecl.ecl.xxx
- that is obviosuly not where it will remain, I therefor consider it unfortunate to introduce deprecation warnings about modules moved fromert.ecl.xxx
toecl.ecl.xxx
- because I assume a new move - and then a new round of deprecations - is imminent in the future. -
Our track record with tasks like: "a major rethinking of the API" is not very good; I fear that we do not have the resources to perform such a task in one go, and that the end result will be that nothing happens.
I agree with many - if not all - the points you raise, but I do feel that the suggested reorganization is one step in the right direction, and most importantly that further steps will be easier after such a reorganization.
from resdata.
I think the above sketched organization makes very much sense from the perspective of libecl
's current state. And if this was the end of the current plan I would immediately say; let's do it!
But, if we agree that we are to change the API of libecl
quite dramatically. Then how about we sit down and see how we would like the new API to be. We might not pull it all the way through, but at least long enough that we get some feeling on whether the reorganization also makes sense with respect to the not so distant future state of the library. So that we avoid, as pointed out above, to point users via a deprecation warning to a place that is also soon to disappear.
I agree that our track record on such tasks are not so good. But if we agree on how it should be done, facilitate this with our future daily work and do some heavy lifting in addition, we should be able to pull something like this through.
from resdata.
But, if we agree that we are to change the API of libecl quite dramatically.
Personally I feel the API is "quite OK" - and do not feel the strong need for a wholesale API redesign, but I understand that there are different opinions on this and I certainly agree that there is room for improvement. But since I do not feel the need for improvements as strong as others, it feels slightly awkward to be the driving force behind such a process.
Then how about we sit down and see how we would like the new API to be
In general this is of course a good idea; I fully support that - but I think the ambition for such a meeting should be to agree on a general direction, and then we should just do small tasks in the right direction. If the ambition is to specify a "perfect API" we all agree upon I can just reiterate my previous comments of track record - I fear we will never get there - not even in the design phase, let alone the implementation.
Given limited resources and the size of the task at hand I am a very strong believer in small incremental changes which can be completed 100%. I think we should all be better at appreciating small changes in the right direction, instead of critcising that things are not perfect - they never will be.
Anyway this and this are small changes which I think is in the direction @pgdr suggests.
from resdata.
I don't have much to add, the situation is quite clear: a big refactoring of the API would be (probably) the best option, but it's risky. A small incremental step is safer, but we may piss off the users by changing the API too often.
In general I'd suggest to go fr the small changes, but I was wondering, who are the main users (or, the people who'd be mainly affected by this change)?
If the answwer is "us" (libres, opm, everest, whatsoever), then we should take into account also the cost of adopting the new API. Small incremental steps may require us to update all the other programs at every step (or, even worse, we'll have different rograms that work with different versions of ecl).
If this is the situation, then it may be overall more effective to opt for an extensive refactoring in one go
from resdata.
In general this is of course a good idea; I fully support that - but I think the ambition for such a meeting should be to agree on a general direction
Completely agree. Lets see what the next days bring of face to face discussions and then point out a direction from there.
from resdata.
Quite a bit has already been done in this direction. I suggest that we open a new issue whenever/if this process is to be continued.
from resdata.
Related Issues (20)
- Internal error index: -1 on case when multiple using BASIC=6 and RPTONLY HOT 7
- Remove pinning of manylinux2014
- Remove ERT_HAVE_THREAD_POOL
- Support base names of up 136 characters
- Cannot build the project with cmake fetchContent HOT 1
- ISO dates are parsed differently on mac vs linux
- Python 3.11 support
- Upgrade/pin or remove clang-format 14 HOT 1
- Drop support for python 3.6 and 3.7
- Remove dependency on six and future HOT 1
- Windows build is broken HOT 1
- `util_file_readable` does not check what one expects it to check
- EclSum does not handle formatted ecl files correctly
- iget_sim_time assumes date_index is a date
- EclGrid crash with seg.fault when reading EGRID exported from RMS14.1.0 HOT 1
- Python wrappers failed to install HOT 1
- test failures on azure HOT 1
- Docs do not always render great HOT 1
- EclSum doesn't read network vectors HOT 2
- Bug in `_compile_headers_list`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from resdata.