Contribute#

Overall guidance on contributing to a PyAnsys library appears in Contributing in the PyAnsys developer’s guide. Ensure that you are thoroughly familiar with this guide before attempting to contribute to the Ansys SCADE smart boiler control example.

The following contribution information is specific to the Ansys SCADE smart boiler control interface.

Install in developer mode#

Installing the Ansys SCADE smart boiler control interface in developer mode allows you to modify the source and enhance it.

  1. Clone the ansys-scade-example-smart-boiler-control repository:

    git clone https://github.com/ansys/scade-example-smart-boiler-control.git
    
  2. Access the scade-example-smart-boiler-control directory where the repository has been cloned:

    cd scade-example-smart-boiler-control
    
  3. Create a clean Python 3.10 environment and activate it:

    You should use the interpreter delivered with Ansys SCADE. For example, C:\Program Files\ANSYS Inc\v232\SCADE\contrib\Python310\python.exe.

    # Create a virtual environment
    python -m venv .venv
    
    # Activate it in Windows CMD environment
    .venv\Scripts\activate.bat
    
    # Activate it in Windows Powershell
    .venv\Scripts\Activate.ps1
    
  4. Make sure that you have the latest required build system, documentation, testing, and CI tools:

    python -m pip install -U pip     # Upgrading pip
    python -m pip install -r requierements/doc.txt     # for building the documentation
    

Use pre-commit#

The example for the Ansys SCADE boiler plate interface follows the PEP8 standard as outlined in PEP 8 in the PyAnsys developer’s guide and implements style checking using pre-commit.

To ensure your code meets minimum code styling standards, run these commands:

pip install pre-commit
pre-commit run --all-files

You can also install this as a pre-commit hook by running this command:

pre-commit install

This way, it’s not possible for you to push code that fails the style checks:

$ pre-commit install
$ git commit -am "added my cool feature"
Add License Headers......................................................Passed
check for merge conflicts................................................Passed
debug statements (python)................................................Passed
trim trailing whitespace.................................................Passed
check yaml...............................................................Passed
fix requirements.txt.....................................................Passed
Check GitHub workflows...................................................Passed

Build documentation#

To build documentation, you can run these commands:

# build and view the doc from a Windows environment
.\doc\make.bat clean
.\doc\make.bat html
start .\doc\_build\html\index.html

Post issues#

Use the Issues page for this repository to report bugs and request new features. When possible, use the issue templates provided. If your issue does not fit into one of these templates, click the link for opening a blank issue.

If you have general questions about the PyAnsys ecosystem, email pyansys.core@ansys.com. If your question is specific to the Ansys SCADE smart boiler control interface, ask your question in an issue as described in the previous paragraph.