lanl / lanl/dfnWorks

Easier installation suggestion

Open
#77 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
96
Forks
53
Avg merge
2h 58m
Merged PRs (30d)
2

Description

Hi again!

I am opening another issue since it is completely unrelated from the first that I made today.

DFNWorks is fantastic but I find it a bit cumbersome to install and use pydfnworks.
All the different components to compile locally in multiple machines and OSs takes quite a bit of time. I was wandering if you ever considered to organize and compact the pip package by including precompiled binaries of lagrit, DFGen etcetc. You could do this by including the binaries in a folder inside the package itself (so for example in pydfnworks>builds).

This would firstly simplify a lot the path management. Since the precompiled libraries are in a folder within the library there won't be the need to use the .dfnworksrc file. Secondly, with a bit of work, it could be possible to make DFNWorks crossplatform!

Implementation of this should not be that difficult because It would require to add the paths of the precompiled libraries in the package_data dict in setup.py like this:

        ...
        package_data={'': ['dfnGen/generation/output_report/figures/*png',
                           'builds/ConnectivityTest',
                           'builds/correct_stor',
                           'builds/correct_uge',
                           'builds/DFNGen',
                           'builds/lagrit',]}
      )

and then add in the init.py a way to get the internal path (that is also the the dfnworks_PATH). Something like this:

...
file_path = os.path.realpath(__file__)

internal_filepath = os.path.dirname(file_path)
os.environ['dfnworks_PATH'] = internal_filepath

os.environ['DFNGEN_EXE'] = os.path.join(os.environ['dfnworks_PATH'], 'builds/DFNGen')
os.environ['CORRECT_UGE_EXE'] = os.path.join(os.environ['dfnworks_PATH'], 'builds/correct_uge')
os.environ['CORRECT_STOR_EXE'] = os.path.join(os.environ['dfnworks_PATH'], 'builds/correct_stor')
os.environ['CONNECT_TEST_EXE'] = os.path.join(os.environ['dfnworks_PATH'], 'builds/ConnectivityTest')
os.environ['LAGRIT_EXE'] = os.path.join(os.environ['dfnworks_PATH'], 'builds/lagrit')
...

The difficult part would be to automate the compilation of the different libraries (maybe using github actions?).

Let me know your thoughts about this!

Thank you again!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with setup.py and init.py, focusing on package_data, the builds directory, and the environment variables for the bundled executables. Review how compilation of DFNGen, LaGriT, and the other listed binaries could be automated with GitHub Actions; done means installation no longer requires separate local builds or a .dfnworksrc path configuration across supported platforms.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, python
Domain
build-system, devops
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.