Skip to content
Merged
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
* PyGridSim version:
* Python version:
* Operating System:

### Description

Describe what you were trying to get done.
Tell us what happened, what went wrong, and what you expected to happen.

### What I Did

```
Paste the command(s) you ran and the output.
If there was a crash, please include the traceback here.
```
61 changes: 61 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Run Tests

on:
push:
branches: [ '*' ]
pull_request:
branches: [ main ]

jobs:
docs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install package
run: |
python -m pip install --upgrade pip setuptools
pip install .[dev]
- name: make docs
run: make docs

lint:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install package and dependencies
run: pip install .[dev]
- name: make lint
run: make lint

test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install package and dependencies
run: pip install .[test]
- name: make test
run: make test
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ install-test: clean-build clean-pyc ## install the package and test dependencies

.PHONY: test
test: ## run tests quickly with the default Python
python -m pytest --basetemp=${ENVTMPDIR} --cov=pygridsim --cov-report xml
python -m pytest --cov=pygridsim --cov-report xml

.PHONY: lint
lint: ## check style with flake8 and isort
Expand Down
8 changes: 4 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# relative to the documentation root, use os.path.abspath to make it
# absolute, like shown here.

import sphinx_rtd_theme # For read the docs theme
import sphinx_rtd_theme # For read the docs theme

import pygridsim

Expand All @@ -31,12 +31,12 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [
'm2r',
'm2r2',
'sphinx.ext.autodoc',
'sphinx.ext.githubpages',
'sphinx.ext.viewcode',
'sphinx.ext.napoleon',
'autodocsumm',
'sphinx.ext.autosummary',
]

autodoc_default_options = {
Expand Down Expand Up @@ -76,7 +76,7 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = 'en'

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand Down
4 changes: 3 additions & 1 deletion pygridsim/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@
__email__ = '[email protected]'
__version__ = '0.1.0.dev1'

from pygridsim.core import PyGridSim as PyGridSim
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need this if you would like to keep from pygridsim import PyGridSim. To overcome lint complaints, you can do the following:

from pygridsim.core import PyGridSim

__all__ = ('PyGridSim')

Then the "unused" imports will no longer be an error.

from pygridsim.core import PyGridSim

__all__ = ['PyGridSim']
26 changes: 13 additions & 13 deletions pygridsim/configs.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
from pygridsim.enums import LoadType, LineType, GeneratorType, SourceType
import pygridsim.defaults as defaults
from pygridsim.enums import GeneratorType, LineType, LoadType, SourceType

LOAD_CONFIGURATIONS = {
LoadType.HOUSE: {
"kV": defaults.HOUSE_KV,
"kW": defaults.HOUSE_KW,
"kV": defaults.HOUSE_KV,
"kW": defaults.HOUSE_KW,
"kvar": defaults.HOUSE_KVAR
},
LoadType.COMMERCIAL: {
"kV": defaults.COMMERCIAL_KV,
"kW": defaults.COMMERCIAL_KW,
"kW": defaults.COMMERCIAL_KW,
"kvar": defaults.COMMERCIAL_KVAR
},
LoadType.INDUSTRIAL: {
"kV": defaults.INDUSTRIAL_KV,
"kW": defaults.INDUSTRIAL_KW,
"kV": defaults.INDUSTRIAL_KV,
"kW": defaults.INDUSTRIAL_KW,
"kvar": defaults.INDUSTRIAL_KVAR
}
}
Expand Down Expand Up @@ -54,15 +54,15 @@

GENERATOR_CONFIGURATIONS = {
GeneratorType.SMALL: {
"kV": defaults.SMALL_GEN_KV,
"kW": defaults.SMALL_GEN_KW,
"kV": defaults.SMALL_GEN_KV,
"kW": defaults.SMALL_GEN_KW,
},
GeneratorType.LARGE: {
"kV": defaults.LARGE_GEN_KV,
"kW": defaults.LARGE_GEN_KW,
"kV": defaults.LARGE_GEN_KV,
"kW": defaults.LARGE_GEN_KW,
},
GeneratorType.INDUSTRIAL: {
"kV": defaults.INDUSTRIAL_GEN_KV,
"kW": defaults.INDUSTRIAL_GEN_KW,
"kV": defaults.INDUSTRIAL_GEN_KV,
"kW": defaults.INDUSTRIAL_GEN_KW,
}
}
}
Loading