Skip to content

Commit 5b8bb36

Browse files
committed
rebase with the test-fixed main branch
2 parents 532c98f + 205b4b4 commit 5b8bb36

File tree

15 files changed

+382
-264
lines changed

15 files changed

+382
-264
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
* PyGridSim version:
2+
* Python version:
3+
* Operating System:
4+
5+
### Description
6+
7+
Describe what you were trying to get done.
8+
Tell us what happened, what went wrong, and what you expected to happen.
9+
10+
### What I Did
11+
12+
```
13+
Paste the command(s) you ran and the output.
14+
If there was a crash, please include the traceback here.
15+
```

.github/workflows/tests.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Run Tests
2+
3+
on:
4+
push:
5+
branches: [ '*' ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
docs:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
python-version: ["3.10", "3.11", "3.12"]
15+
os: [ubuntu-latest]
16+
steps:
17+
- uses: actions/checkout@v1
18+
- name: Set up Python ${{ matrix.python-version }}
19+
uses: actions/setup-python@v2
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
- name: Install package
23+
run: |
24+
python -m pip install --upgrade pip setuptools
25+
pip install .[dev]
26+
- name: make docs
27+
run: make docs
28+
29+
lint:
30+
runs-on: ${{ matrix.os }}
31+
strategy:
32+
matrix:
33+
python-version: ["3.10", "3.11", "3.12"]
34+
os: [ubuntu-latest, macos-latest]
35+
steps:
36+
- uses: actions/checkout@v1
37+
- name: Set up Python ${{ matrix.python-version }}
38+
uses: actions/setup-python@v2
39+
with:
40+
python-version: ${{ matrix.python-version }}
41+
- name: Install package and dependencies
42+
run: pip install .[dev]
43+
- name: make lint
44+
run: make lint
45+
46+
test:
47+
runs-on: ${{ matrix.os }}
48+
strategy:
49+
matrix:
50+
python-version: ["3.10", "3.11", "3.12"]
51+
os: [ubuntu-latest, macos-latest, windows-latest]
52+
steps:
53+
- uses: actions/checkout@v1
54+
- name: Set up Python ${{ matrix.python-version }}
55+
uses: actions/setup-python@v2
56+
with:
57+
python-version: ${{ matrix.python-version }}
58+
- name: Install package and dependencies
59+
run: pip install .[test]
60+
- name: make test
61+
run: make test

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Byte-compiled / optimized / DLL files
22
__pycache__/
3+
sim.json
34
*.py[cod]
45
*$py.class
56

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ install-test: clean-build clean-pyc ## install the package and test dependencies
3939

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

4444
.PHONY: lint
4545
lint: ## check style with flake8 and isort

docs/conf.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# relative to the documentation root, use os.path.abspath to make it
1919
# absolute, like shown here.
2020

21-
import sphinx_rtd_theme # For read the docs theme
21+
import sphinx_rtd_theme # For read the docs theme
2222

2323
import pygridsim
2424

@@ -31,12 +31,12 @@
3131
# Add any Sphinx extension module names here, as strings. They can be
3232
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
3333
extensions = [
34-
'm2r',
34+
'm2r2',
3535
'sphinx.ext.autodoc',
3636
'sphinx.ext.githubpages',
3737
'sphinx.ext.viewcode',
3838
'sphinx.ext.napoleon',
39-
'autodocsumm',
39+
'sphinx.ext.autosummary',
4040
]
4141

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

8181
# List of patterns, relative to source directory, that match files and
8282
# directories to ignore when looking for source files.

pygridsim/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@
66
__email__ = '[email protected]'
77
__version__ = '0.1.0.dev1'
88

9-
from pygridsim.core import PyGridSim as PyGridSim
9+
from pygridsim.core import PyGridSim
10+
11+
__all__ = ['PyGridSim']

pygridsim/configs.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
from pygridsim.enums import LoadType, LineType, GeneratorType, SourceType
21
import pygridsim.defaults as defaults
2+
from pygridsim.enums import GeneratorType, LineType, LoadType, SourceType
33

44
LOAD_CONFIGURATIONS = {
55
LoadType.HOUSE: {
6-
"kV": defaults.HOUSE_KV,
7-
"kW": defaults.HOUSE_KW,
6+
"kV": defaults.HOUSE_KV,
7+
"kW": defaults.HOUSE_KW,
88
"kvar": defaults.HOUSE_KVAR
99
},
1010
LoadType.COMMERCIAL: {
1111
"kV": defaults.COMMERCIAL_KV,
12-
"kW": defaults.COMMERCIAL_KW,
12+
"kW": defaults.COMMERCIAL_KW,
1313
"kvar": defaults.COMMERCIAL_KVAR
1414
},
1515
LoadType.INDUSTRIAL: {
16-
"kV": defaults.INDUSTRIAL_KV,
17-
"kW": defaults.INDUSTRIAL_KW,
16+
"kV": defaults.INDUSTRIAL_KV,
17+
"kW": defaults.INDUSTRIAL_KW,
1818
"kvar": defaults.INDUSTRIAL_KVAR
1919
}
2020
}
@@ -54,15 +54,15 @@
5454

5555
GENERATOR_CONFIGURATIONS = {
5656
GeneratorType.SMALL: {
57-
"kV": defaults.SMALL_GEN_KV,
58-
"kW": defaults.SMALL_GEN_KW,
57+
"kV": defaults.SMALL_GEN_KV,
58+
"kW": defaults.SMALL_GEN_KW,
5959
},
6060
GeneratorType.LARGE: {
61-
"kV": defaults.LARGE_GEN_KV,
62-
"kW": defaults.LARGE_GEN_KW,
61+
"kV": defaults.LARGE_GEN_KV,
62+
"kW": defaults.LARGE_GEN_KW,
6363
},
6464
GeneratorType.INDUSTRIAL: {
65-
"kV": defaults.INDUSTRIAL_GEN_KV,
66-
"kW": defaults.INDUSTRIAL_GEN_KW,
65+
"kV": defaults.INDUSTRIAL_GEN_KV,
66+
"kW": defaults.INDUSTRIAL_GEN_KW,
6767
}
68-
}
68+
}

0 commit comments

Comments
 (0)