i2x Tool Developers
Familiarity with git and Python is expected. Experience with OpenDSS is also helpful. The steps for working on the i2x Python code are:
From your local directory of software projects:
git clone https://github.com/pnnl/i2x.gitcd i2xpip install -e .to install i2x from your local copy of the code.
The steps for deployment to PyPi are (Starting in the parent directory of src, where setup.py is located):
Make sure that the version number in
version.pyis newrm -rf dist: Removes the wheel folder (if exists. userd /s /q distin windows cmd.exe)python -m build: Builds the wheel (note: this can take a while.buildmay need to be installedconda install buildorpip install build)twine check dist/*should not show any errors (This of the wheel.twinemay need to be installedconda install twineorpip install twine)twine upload -r testpypi dist/*requires project credentials for i2x on test.pypi.org (Note: this will reject if version already exists, also note that testpypi is a separate register to pypi)pip install -i https://test.pypi.org/simple/ i2x==0.0.8for local testing of the deployable package, example version 0.0.8 (Note: some might want to this in a separate test environment)twine upload dist/*final deployment; requires project credentials for i2x on pypi.org (if 2-Factor-Authentication is enabled an API token needs to be used.)
To run the documentation locally:
Make sure the required packages are installed. Go to the
i2x/docs/directory and runpip install -r Requrirements.txt --upgrade-strategy only-if-neededFrom the
i2xdirectory run:sphinx-autobuild docs docs/_build/html. This will create a live updating webpage at http://127.0.0.1:8000 where the local documentation can be viewed. The server can be shutdown with ctrl+c.See the sphinx-guide for syntax help.