Skip to content

Commit

Permalink
Release 0.4.0 (#71)
Browse files Browse the repository at this point in the history
* add get method for a component

* Update README.rst

* add extends argument manipulation

* do not save temp file

* build(deps): bump pygments from 2.12.0 to 2.15.0

Bumps [pygments](https://github.com/pygments/pygments) from 2.12.0 to 2.15.0.
- [Release notes](https://github.com/pygments/pygments/releases)
- [Changelog](https://github.com/pygments/pygments/blob/master/CHANGES)
- [Commits](pygments/pygments@2.12.0...2.15.0)

---
updated-dependencies:
- dependency-name: pygments
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update test_model.py

* add method for getting and setting parameters

* cleanup

* add dictionary

* fix end of dict fileg

* Bump version and update test dependencies (#62)

* bump version and update test depends

* prepare the last of the release items

* update _source on save_as (#64)

* update deprecated call to pkg_resources (#65)

* update deprecated call to pkg_resources

* argh, pre-commit

* import from `typing` instead of `typing.io`

* Add poetry and remove tox (#67)

* remove tox and add poetry

* run pre-commit

* add benchmark package

* add building of doc in test

* update dependendencies

* precommit

* Move Modelica methods over from GMT (#68)

* remove tox and add poetry

* run pre-commit

* add benchmark package

* add building of doc in test

* update dependendencies

* precommit

* move modelica methods from gmt

---------

Co-authored-by: Nathan Moore <nathan.moore@nrel.gov>

* Update antlr4 and use a non-deprecated docker base image (#66)

* update antlr4 to 4.13.0

* bump to antlrv4.13.1

* `poetry update` to bump dependency versions

* remove redundant CI run

* use os & python version matrix in github ci

* eek, found an obvious miss of another antlr version mention

* another `poetry update` to pick up the new antlr runtime version

* use new base image in dockerfile

* rebuild docker container

* remove Windows from CI, it's too soon for that

* update changelog (#70)

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Nathan Moore <nathan.moore@nrel.gov>
  • Loading branch information
3 people authored Oct 5, 2023
1 parent ae48c3b commit 05b1efb
Show file tree
Hide file tree
Showing 64 changed files with 67,501 additions and 1,163 deletions.
45 changes: 45 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"version": "0.2",
"language": "en",
"words": [
"autoload",
"buildingspy",
"cmdclass",
"Combi",
"cvrmsd",
"dassl",
"dymola",
"GDHC",
"IBPSA",
"Jing",
"jinga",
"klass",
"levelname",
"libfortran",
"linecount",
"maxdepth",
"mfrt",
"microgrid",
"Modelica",
"MODELICAPATH",
"mofile",
"nllong",
"openstudio",
"Optimica",
"oversizing",
"pygments",
"redeclarations",
"Reparse",
"searchpath",
"setpoint",
"tanushree",
"Templatized",
"timeseries",
"timestep",
"urbanopt",
"vtnate"
],
"flagWords": [
"hte"
]
}
5 changes: 0 additions & 5 deletions .cspell/custom-dictionary.txt

This file was deleted.

40 changes: 25 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,40 @@ name: CI

on:
push:
pull_request:
branches: ["develop", "main"]

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.9", "3.11"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Set up package
python-version: ${{ matrix.python-version }}
- name: Install Poetry
# optionally set specific poetry version. Defaults to latest
uses: Gr1N/setup-poetry@v8
- name: Install dependencies with Poetry
# poetry setuptools workaround sourced from:
# https://github.com/python-poetry/poetry/issues/7611#issuecomment-1711443539
run: |
pip install -U pip setuptools
pip install tox coveralls
pip install -r requirements.txt
pre-commit install
- name: Run tox
run: tox
poetry --version
poetry self add setuptools
poetry install
- name: Run pre-commit
run: pre-commit run --all-files
run: poetry run pre-commit run --all-files
- name: Build docs
run: |
cd docs && poetry run make html && cd ..
- name: Run pytest
run: poetry run pytest -v --cov-report term-missing --cov
- name: Coveralls
if: ${{ success() }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: coveralls --service=github
run: poetry run coveralls --service=github
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ tags
# Unittest and coverage
htmlcov/*
.coverage
.tox
junit.xml
coverage.xml
.pytest_cache/

# Build and docs folder/files
build/*
docs/build/*
dist/*
sdist/*
../modelica-builder/docs/api/*
Expand Down
2 changes: 1 addition & 1 deletion .isort.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[settings]
line_length=88
indent=' '
skip=.tox,.venv,build,dist
skip=.venv,build,dist
known_standard_library=setuptools,pkg_resources
known_test=pytest
known_first_party=modelica_builder
Expand Down
7 changes: 4 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ repos:
--skip=seed/models/__init__.py,
--filter-files,
]
- repo: https://github.com/humitos/mirrors-autoflake.git
rev: v1.1
- repo: https://github.com/PyCQA/autoflake
rev: v2.2.1
hooks:
- id: autoflake
args:
Expand All @@ -40,6 +40,7 @@ repos:
"--recursive",
"--remove-all-unused-imports",
"--remove-unused-variable",
"--ignore-init-module-imports",
]
- repo: https://github.com/pycqa/flake8
rev: 6.1.0
Expand All @@ -48,7 +49,7 @@ repos:
args:
["--ignore=F401,E402,E501,E731,W503,W504", "--max-line-length=100"]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.1
rev: v3.0.3
hooks:
- id: prettier
# for now ignoring html, javascript
Expand Down
21 changes: 21 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,27 @@
Changelog
=========

Version 0.4.0
=============

## What's Changed
* Add get method for a component's argument by @nllong in https://github.com/urbanopt/modelica-builder/pull/57
* Update README.rst by @nllong in https://github.com/urbanopt/modelica-builder/pull/58
* build(deps): bump pygments from 2.12.0 to 2.15.0 by @dependabot in https://github.com/urbanopt/modelica-builder/pull/60
* Add extends redeclare update method by @nllong in https://github.com/urbanopt/modelica-builder/pull/59
* Add method for getting and setting parameters by @nllong in https://github.com/urbanopt/modelica-builder/pull/61
* Bump version and update test dependencies by @nllong in https://github.com/urbanopt/modelica-builder/pull/62
* update _source filename when calling save_as by @nllong in https://github.com/urbanopt/modelica-builder/pull/64
* update deprecated import statements by @vtnate in https://github.com/urbanopt/modelica-builder/pull/65
* Add poetry and remove tox by @nllong in https://github.com/urbanopt/modelica-builder/pull/67
* Move Modelica methods over from GMT by @nllong in https://github.com/urbanopt/modelica-builder/pull/68
* Update antlr4 and use a non-deprecated docker base image by @vtnate in https://github.com/urbanopt/modelica-builder/pull/66

## New Contributors
* @vtnate made their first contribution in https://github.com/urbanopt/modelica-builder/pull/65

**Full Changelog**: https://github.com/urbanopt/modelica-builder/compare/v0.3.0...v0.4.0

Version 0.3.0
=============

Expand Down
31 changes: 13 additions & 18 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Modelica Builder
================

The Modelica Builder project aims to make in-place modifcations to Modelica language files easier.
The Modelica Builder project aims to make in-place modifications to Modelica language files easier.
The principal use case is to load, modify using higher level abstracted methods, and then save the
resulting file. The user has access to the entire Abstract Syntax Tree of the entire Modelica grammar.

Expand Down Expand Up @@ -74,10 +74,14 @@ See the tests for more examples and information.
Development
-----------

For developers, dependency management is through `Poetry`_. Installation is accomplished by running :code:`pip install poetry`.

.. code-block:: bash
pip install poetry
# install after cloning repo
pip install -r requirements.txt
poetry install
If you change the source grammar file you need to regenerate the parser and lexer.

Expand Down Expand Up @@ -124,9 +128,9 @@ Testing

To run the tests, simply run the following:

.. code-block:: python
.. code-block:: bash
py.test
poetry run pytest
Known Issues
------------
Expand All @@ -137,7 +141,7 @@ Release Instructions
--------------------

* Bump version to <NEW_VERSION> in setup.cfg (use semantic versioning as much as possible).
* Run `pre-commit --all-files`
* Run `poetry run pre-commit --all-files`
* In a prep-release branch, push the changes to GitHub and draft a release against the latest branch.
* Run 'auto-generate changelog' and copy the contents to the CHANGELOG.rst. Cull any items that are repeated.
* Discard the draft release (you will create an official one off of the main branch)
Expand All @@ -150,23 +154,14 @@ Release Instructions
# Remove old dist packages
rm -rf dist/*
python setup.py sdist
* Verify that the files in the dist/* folder have the correct version (no dirty, no sha)

.. code-block:: bash
pip install twine
twine check dist/*
* Run the following to release

.. code-block:: bash
twine upload dist/*
poetry publish --build
* Push the tag to GitHub after everything is published to PyPi, then go to GitHub and add in the CHANGELOG.rst notes into the tagged release and officially release.

.. code-block:: bash
git push origin <NEW_VERSION>
.. _Poetry: https://python-poetry.org/docs/
8 changes: 4 additions & 4 deletions antlr/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM openjdk:7-alpine
FROM eclipse-temurin:17

WORKDIR /usr/local/lib
RUN wget https://www.antlr.org/download/antlr-4.8-complete.jar
ENV CLASSPATH=".:/usr/local/lib/antlr-4.8-complete.jar:$CLASSPATH"
RUN wget https://www.antlr.org/download/antlr-4.13.1-complete.jar
ENV CLASSPATH=".:/usr/local/lib/antlr-4.13.1-complete.jar:$CLASSPATH"

ENTRYPOINT ["java", "-jar", "/usr/local/lib/antlr-4.8-complete.jar"]
ENTRYPOINT ["java", "-jar", "/usr/local/lib/antlr-4.13.1-complete.jar"]
CMD []
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = ../build/sphinx/
BUILDDIR = build
AUTODOCDIR = api
AUTODOCBUILD = sphinx-apidoc
PROJECT = modelica-builder
Expand Down
45 changes: 45 additions & 0 deletions docs/api/modelica_builder.modelica_parser.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
modelica\_builder.modelica\_parser package
==========================================

Submodules
----------

modelica\_builder.modelica\_parser.modelicaLexer module
-------------------------------------------------------

.. automodule:: modelica_builder.modelica_parser.modelicaLexer
:members:
:undoc-members:
:show-inheritance:

modelica\_builder.modelica\_parser.modelicaListener module
----------------------------------------------------------

.. automodule:: modelica_builder.modelica_parser.modelicaListener
:members:
:undoc-members:
:show-inheritance:

modelica\_builder.modelica\_parser.modelicaParser module
--------------------------------------------------------

.. automodule:: modelica_builder.modelica_parser.modelicaParser
:members:
:undoc-members:
:show-inheritance:

modelica\_builder.modelica\_parser.utils module
-----------------------------------------------

.. automodule:: modelica_builder.modelica_parser.utils
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: modelica_builder.modelica_parser
:members:
:undoc-members:
:show-inheritance:
Loading

0 comments on commit 05b1efb

Please sign in to comment.