Skip to content

Commit

Permalink
Merge pull request #13 from jinningwang/develop
Browse files Browse the repository at this point in the history
v0.7.4
  • Loading branch information
jinningwang authored Nov 29, 2023
2 parents d3b179e + dd4551a commit 19bc3ac
Show file tree
Hide file tree
Showing 51 changed files with 4,358 additions and 1,957 deletions.
39 changes: 39 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: cuihantao

---

**Describe the bug**

A clear and concise description of what the bug is.

**To Reproduce**

Update data files and code for reproducing the error.

If you need to insert code inline, use a pair of triple backticks to format:

```python
Code goes here
```

**Expected behavior**

A clear and concise description of what you expected to happen.

**Desktop (please complete the following information):**

- OS: [e.g. Windows]
- AMS version (please paste the output from `ams misc --version`)


**pip packages (please paste the output from `pip list`)**


**Additional context**

Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees:

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
8 changes: 8 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Fixes #

## Proposed Changes

-
-
-

43 changes: 43 additions & 0 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Python application

on: [push, pull_request]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.9
- name: Install dependencies
run: |
# work around a pip issue with extras_require: https://github.com/pypa/pip/issues/8323
python -m pip install -U "pip @ git+https://github.com/pypa/pip.git"
python -m pip install --upgrade pip
python -m pip install .[all]
python -m pip install nbmake==0.10 pytest-xdist line_profiler # add'l packages for notebook tests.
# - name: Lint with flake8 for pull requests
# if: github.event_name == 'pull_request'
# run: |
# # stop the build if there are Python syntax errors or undefined names
# flake8 .
- name: Test with pytest
run: |
pytest --log-cli-level=10
# - name: Test notebooks.
# run: |
# pytest --log-cli-level=10 --nbmake examples --ignore=examples/verification
# - name: Build a distribution if tagged
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
# run: |
# python setup.py sdist
# - name: Publish a Python distribution to PyPI if tagged
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
# uses: pypa/gh-action-pypi-publish@master
# with:
# user: __token__
# password: ${{ secrets.pypi_password }}
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,7 @@ _generated
icebar

# example excel files cache
~$*.xlsx
~$*.xlsx

# conda
.conda/*
72 changes: 48 additions & 24 deletions ams/cases/5bus/pjm5bus_uced.json
Original file line number Diff line number Diff line change
Expand Up @@ -722,145 +722,169 @@
"idx": "EDT1",
"u": 1.0,
"name": "EDT1",
"sd": "0.793,0.0"
"sd": "0.793,0.0",
"ug": "1,1,1,1"
},
{
"idx": "EDT2",
"u": 1.0,
"name": "EDT2",
"sd": "0.756,0.0"
"sd": "0.756,0.0",
"ug": "1,1,1,1"
},
{
"idx": "EDT3",
"u": 1.0,
"name": "EDT3",
"sd": "0.723,0.0"
"sd": "0.723,0.0",
"ug": "1,1,1,1"
},
{
"idx": "EDT4",
"u": 1.0,
"name": "EDT4",
"sd": "0.708,0.0"
"sd": "0.708,0.0",
"ug": "1,1,1,1"
},
{
"idx": "EDT5",
"u": 1.0,
"name": "EDT5",
"sd": "0.7,0.0"
"sd": "0.7,0.0",
"ug": "1,1,1,1"
},
{
"idx": "EDT6",
"u": 1.0,
"name": "EDT6",
"sd": "0.706,0.0"
"sd": "0.706,0.0",
"ug": "1,1,1,1"
},
{
"idx": "EDT7",
"u": 1.0,
"name": "EDT7",
"sd": "0.75,0.0"
"sd": "0.75,0.0",
"ug": "1,1,1,1"
},
{
"idx": "EDT8",
"u": 1.0,
"name": "EDT8",
"sd": "0.802,0.0"
"sd": "0.802,0.0",
"ug": "1,1,1,1"
},
{
"idx": "EDT9",
"u": 1.0,
"name": "EDT9",
"sd": "0.828,0.0"
"sd": "0.828,0.0",
"ug": "1,1,1,1"
},
{
"idx": "EDT10",
"u": 1.0,
"name": "EDT10",
"sd": "0.851,0.0"
"sd": "0.851,0.0",
"ug": "1,1,1,1"
},
{
"idx": "EDT11",
"u": 1.0,
"name": "EDT11",
"sd": "0.874,0.0"
"sd": "0.874,0.0",
"ug": "1,1,1,1"
},
{
"idx": "EDT12",
"u": 1.0,
"name": "EDT12",
"sd": "0.898,0.0"
"sd": "0.898,0.0",
"ug": "1,1,1,1"
},
{
"idx": "EDT13",
"u": 1.0,
"name": "EDT13",
"sd": "0.919,0.0"
"sd": "0.919,0.0",
"ug": "1,1,1,1"
},
{
"idx": "EDT14",
"u": 1.0,
"name": "EDT14",
"sd": "0.947,0.0"
"sd": "0.947,0.0",
"ug": "1,1,1,1"
},
{
"idx": "EDT15",
"u": 1.0,
"name": "EDT15",
"sd": "0.97,0.0"
"sd": "0.97,0.0",
"ug": "1,1,1,1"
},
{
"idx": "EDT16",
"u": 1.0,
"name": "EDT16",
"sd": "0.987,0.0"
"sd": "0.987,0.0",
"ug": "1,1,1,1"
},
{
"idx": "EDT17",
"u": 1.0,
"name": "EDT17",
"sd": "1.0,0.0"
"sd": "1.0,0.0",
"ug": "1,1,1,1"
},
{
"idx": "EDT18",
"u": 1.0,
"name": "EDT18",
"sd": "1.0,0.0"
"sd": "1.0,0.0",
"ug": "1,1,1,1"
},
{
"idx": "EDT19",
"u": 1.0,
"name": "EDT19",
"sd": "0.991,0.0"
"sd": "0.991,0.0",
"ug": "1,1,1,1"
},
{
"idx": "EDT20",
"u": 1.0,
"name": "EDT20",
"sd": "0.956,0.0"
"sd": "0.956,0.0",
"ug": "1,1,1,1"
},
{
"idx": "EDT21",
"u": 1.0,
"name": "EDT21",
"sd": "0.93,0.0"
"sd": "0.93,0.0",
"ug": "1,1,1,1"
},
{
"idx": "EDT22",
"u": 1.0,
"name": "EDT22",
"sd": "0.905,0.0"
"sd": "0.905,0.0",
"ug": "1,1,1,1"
},
{
"idx": "EDT23",
"u": 1.0,
"name": "EDT23",
"sd": "0.849,0.0"
"sd": "0.849,0.0",
"ug": "1,1,1,1"
},
{
"idx": "EDT24",
"u": 1.0,
"name": "EDT24",
"sd": "0.784,0.0"
"sd": "0.784,0.0",
"ug": "1,1,1,1"
}
],
"UCTSlot": [
Expand Down
Binary file modified ams/cases/5bus/pjm5bus_uced.xlsx
Binary file not shown.
Binary file added ams/cases/5bus/pjm5bus_uced_esd1.xlsx
Binary file not shown.
Binary file modified ams/cases/ieee123/ieee123_regcv1.xlsx
Binary file not shown.
Binary file modified ams/cases/ieee14/ieee14_uced.xlsx
Binary file not shown.
Binary file removed ams/cases/ieee39/ieee39_esd1.xlsx
Binary file not shown.
Binary file modified ams/cases/ieee39/ieee39_uced.xlsx
Binary file not shown.
Binary file modified ams/cases/ieee39/ieee39_uced_esd1.xlsx
Binary file not shown.
Binary file modified ams/cases/npcc/npcc_uced.xlsx
Binary file not shown.
Binary file modified ams/cases/wecc/wecc_uced.xlsx
Binary file not shown.
29 changes: 19 additions & 10 deletions ams/core/documenter.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,23 +498,32 @@ def _tex_pre(docm, p, tex_map):
"""

# NOTE: in the future, there might occur special math symbols
special_map = OrderedDict([
map_before = OrderedDict([
('sum', 'SUM'),
(r'\sum', 'SUM'),
(r'\eta', 'ETA'),
(r'\gamma', 'GAMMA'),
(r'\theta', 'THETA'),
(r'\frac', 'FRAC'),
(r'\overline', 'OVERLINE'),
(r'\underline', 'UNDERLINE'),
])
map_post = OrderedDict([
('SUM', r'\sum'),
('THETA', r'\theta'),
('ETA', r'\eta'),
('GAMMA', r'\gamma'),
('FRAC', r'\frac'),
('OVERLINE', r'\overline'),
('UNDERLINE', r'\underline'),
])

expr = p.e_str

for pattern, replacement in tex_map.items():
if r'\sum' in replacement:
replacement = replacement.replace(r'\sum', 'SUM')
if r'sum' in expr:
expr = expr.replace('sum', 'SUM')
if '\eta' in replacement:
replacement = replacement.replace('\eta', 'ETA')
if r'\frac' in replacement:
replacement = replacement.replace(r'\frac', 'FRAC')
for key, val in map_before.items():
if key in replacement:
replacement = replacement.replace(key, val)
if r'\p' in replacement:
continue
try:
Expand All @@ -529,7 +538,7 @@ def _tex_pre(docm, p, tex_map):
except re.error:
logger.error('Remains '*' in the expression.')

for pattern, replacement in special_map.items():
for pattern, replacement in map_post.items():
expr = expr.replace(pattern, replacement)

return expr
Loading

0 comments on commit 19bc3ac

Please sign in to comment.