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

Concurrent initialization of project .from_las #246

Open
gavargas22 opened this issue Jan 26, 2025 · 2 comments
Open

Concurrent initialization of project .from_las #246

gavargas22 opened this issue Jan 26, 2025 · 2 comments

Comments

@gavargas22
Copy link
Contributor

I implemented the parallel initialization of a Welly project which happens when you run Welly.from_las method. I used Dask to do it (due to its really easy to use API), and want to make a pull request to share my implementation, but would adding dask to the requirements be a desirable thing? Or would the preference be to use something else that's built into Python?

@frank1010111
Copy link
Collaborator

To synthesize some of the discussion on the SWUNG Mattermost, dask is a heavy dependency for little perceived gain, but polars might be an option.

@frank1010111
Copy link
Collaborator

I ran profiling on the unit tests for welly.from_las and it looks like lasio takes a lot of the time

❯ pytest -k test_to_las --profile
==================================================================================== test session starts =====================================================================================
platform linux -- Python 3.13.1, pytest-8.3.4, pluggy-1.5.0
Matplotlib: 3.9.3
Freetype: 2.6.1
rootdir: /welly
configfile: pyproject.toml
testpaths: tests
plugins: cov-6.0.0, profiling-1.8.1, mpl-0.17.0
collected 95 items / 89 deselected / 6 selected

tests/test_las.py ......                                                                                                                                                               [100%]
Profiling (from /welly/prof/combined.prof):
Sun Feb  2 00:34:08 2025    /welly/prof/combined.prof

         34155201 function calls (34144685 primitive calls) in 49.889 seconds

   Ordered by: cumulative time
   List reduced from 1339 to 20 due to restriction <20>

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        6    0.000    0.000   50.187    8.365 /welly/.venv/lib/python3.13/site-packages/_pytest/runner.py:110(pytest_runtest_protocol)
   122/66    0.001    0.000   50.184    0.760 /welly/.venv/lib/python3.13/site-packages/pluggy/_hooks.py:498(__call__)
        6    0.000    0.000   50.184    8.364 /welly/.venv/lib/python3.13/site-packages/_pytest/runner.py:118(runtestprotocol)
       18    0.000    0.000   50.184    2.788 /welly/.venv/lib/python3.13/site-packages/_pytest/runner.py:226(call_and_report)
   122/66    0.000    0.000   50.184    0.760 welly/.venv/lib/python3.13/site-packages/pluggy/_manager.py:111(_hookexec)
   122/66    0.002    0.000   50.184    0.760 /welly/.venv/lib/python3.13/site-packages/pluggy/_callers.py:53(_multicall)
       18    0.000    0.000   50.180    2.788 /welly/.venv/lib/python3.13/site-packages/_pytest/runner.py:319(from_call)
       18    0.000    0.000   50.179    2.788 /welly/.venv/lib/python3.13/site-packages/_pytest/runner.py:242(<lambda>)
        6    0.000    0.000   50.161    8.360 /welly/.venv/lib/python3.13/site-packages/_pytest/runner.py:163(pytest_runtest_call)
        6    0.000    0.000   50.161    8.360 /welly/.venv/lib/python3.13/site-packages/_pytest/python.py:1625(runtest)
        6    0.005    0.001   50.161    8.360 /welly/.venv/lib/python3.13/site-packages/_pytest/python.py:152(pytest_pyfunc_call)
        6    0.003    0.000   50.156    8.359 /welly/tests/test_las.py:47(test_to_las)
       24    0.001    0.000   31.526    1.314 /welly/.venv/lib/python3.13/site-packages/lasio/las.py:124(__init__)
       18    0.000    0.000   31.524    1.751 /welly/.venv/lib/python3.13/site-packages/lasio/__init__.py:66(read)
       18    0.058    0.003   31.519    1.751 /welly/.venv/lib/python3.13/site-packages/lasio/las.py:141(read)
        6    0.006    0.001   18.474    3.079 /welly/welly/las.py:243(datasets_to_las)
      282    2.125    0.008   16.558    0.059 /welly/.venv/lib/python3.13/site-packages/lasio/reader.py:416(read_data_section_iterative_normal_engine)
  2861733    4.438    0.000   14.262    0.000 /welly/.venv/lib/python3.13/site-packages/lasio/reader.py:456(items)
        6    0.000    0.000   13.161    2.193 /welly/welly/las.py:41(from_las)
        6    0.000    0.000   11.379    1.897/welly/.venv/lib/python3.13/site-packages/lasio/las.py:635(write)

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

No branches or pull requests

2 participants