Skip to content

Commit

Permalink
Merge pull request #2 from rl-institut/windows-install
Browse files Browse the repository at this point in the history
Windows install
  • Loading branch information
ciaradunks authored Apr 9, 2024
2 parents a8595f4 + dcfc382 commit ceb8445
Show file tree
Hide file tree
Showing 89 changed files with 3,083 additions and 224 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# source: https://github.com/github/gitignore/blob/main/Python.gitignore

setup.py

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
58 changes: 10 additions & 48 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,56 +7,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## [0.2.0] Minor Release - Oh Hi Mike - 2023-08-11
## [0.0.1] Initial Release - Hello Super-Repo - 2024-02-27

### Added
- Add documentation version control with mike [(#47)](https://github.com/rl-institut/super-repo/pull/47)
- pyproject.toml
- setup.py to .gitignore
- new requirements files inside a requirements folder
- created `oemof_tabular_plugins/` inside `src/` folder

### Changed
- Update issue templates and release procedure [(#47)](https://github.com/rl-institut/super-repo/pull/47)


## [0.1.1] Patch Release - Emmy Hennings Day Patch - 2023-08-10

### Added
- Add issue template for release `issue_template_release.md` [(#43)](https://github.com/rl-institut/super-repo/pull/43)

### Changed
- Update the release procedure [(#43)](https://github.com/rl-institut/super-repo/pull/43)


## [0.1.0] Minor Release - Emmy Hennings Day - 2023-08-10

### Added
- [LICENSE.txt](https://github.com/rl-institut/super-repo/blob/main/LICENSE.txt)
- CITATION.cff [(#2)](https://github.com/rl-institut/super-repo/pull/2)
- CONTRIBUTING.md [(#2)](https://github.com/rl-institut/super-repo/pull/2)
- USERS.cff [(#2)](https://github.com/rl-institut/super-repo/pull/2)
- CODE_OF_CONDUCT.md [(#3)](https://github.com/rl-institut/super-repo/pull/3)
- CHANGELOG.md [(#6)](https://github.com/rl-institut/super-repo/pull/6)
- README.rst [(#10)](https://github.com/rl-institut/super-repo/pull/10)
- Add a logo to the README [(#18)](https://github.com/rl-institut/super-repo/pull/18)
- Add mkdocstrings [(#20)](https://github.com/rl-institut/super-repo/pull/20)
- Add example code with google docstrings [(#20)](https://github.com/rl-institut/super-repo/pull/20)
- Add `requirements.txt` for python environment dependencies [(#20)](https://github.com/rl-institut/super-repo/pull/20)
- Add templates for issues and PR [(#15)](https://github.com/rl-institut/super-repo/pull/15)
- Add a GitHub workflow to deploy documentation [(#25)](https://github.com/rl-institut/super-repo/pull/25)
- Add permanent links for documentation sections [(#28)](https://github.com/rl-institut/super-repo/pull/28)
- Add documentation on documentation files [(#35)](https://github.com/rl-institut/super-repo/pull/35
- Add `RELEASE_PROCEDURE.md` [(#37)](https://github.com/rl-institut/super-repo/pull/37)

### Changed
- Update the .gitignore [(#19)](https://github.com/rl-institut/super-repo/pull/19)
- Update the documentation file structure [(#28)](https://github.com/rl-institut/super-repo/pull/28)

### Removed
- Remove the `src` folder [(#26)](https://github.com/rl-institut/super-repo/pull/26)


## [0.0.0] Initial Release - Hello Super-Repo - 2022-03-03

### Added
- GitHub repository
- .gitignore
- Changelog
- USERS.cff
- CITATIONS.cff
- moved requirements from a file to a folder structure similar to the one of Numpy
- LICENSE (MIT License)
- [GitHub Projects](https://github.com/rl-institut/super-repo/projects?type=classic) for software versioning

21 changes: 13 additions & 8 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
cff-version: 1.2.0
message: "If you use this software, please cite it using these metadata."
authors:
- family-names: "Hülk"
given-names: "Ludwig"
alias: "@Ludee"
- family-names: "Dunks"
given-names: "Ciara"
alias: "@ciaradunks"
affiliation: "Reiner Lemoine Institut"
orcid: "https://orcid.org/0000-0003-4655-2321"
title: "Super Repo"
orcid: ""
- family-names: "Duc"
given-names: "Pierre-François"
alias: "@Bachibouzouk"
affiliation: "Reiner Lemoine Institut"
orcid: ""
title: "oemof-tabular plugins"
type: software
license: MIT
version: 0.2.0
version: 0.0.1
doi:
date-released: 2023-08-11
url: "https://github.com/rl-institut/super-repo/"
date-released: 2024-02-28
url: "https://github.com/rl-institut/oemof-tabular-plugins"
38 changes: 38 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,3 +178,41 @@ Check that all steps have been documented:
- Entry in CHANGELOG.md?
- PR is closed?
- Issue is closed?

### 6. Release

As on pypi.org, one is allowed to upload a given version only once, one need a way to test a release before making it official. This is the purpose of a release candidate.
Technically, a release candidate is similar to a normal release in the sense that someone can `pip install` them. However users will know that the release candidate is only there for test purposes.

1. Open a working python3 virtual environment and make sure you have the latest versions of setuptools and wheel installed:
```bash
pip install --upgrade setuptools wheel twine
```
2. Make sure you pulled the latest version of `dev` branch from `origin`: `git checkout dev`, `git pull origin`.
3. Change the version (without committing) with release candidates (add `rc1` to the `version_num`, for example `vX.Y.Zrc1`) before the actual release, as a release with a specific version number can only be uploaded once on pypi.
4. Move to the root of your local copy of this repository and prepare the python package and remove previous version distribution files with
```bash
python prepare_release.py
```
The last two lines should show the result of the twine check:
```
Checking dist/oemof_tabular_plugins-0.0.1rc2-py3-none-any.whl: PASSED
Checking dist/oemof-tabular-plugins-0.0.1rc2.tar.gz: PASSED
```
If one of the two is not `PASSED`, find out why and fix it.

5. If the twine check passed you can now upload the package release candidate to pypi.org
1. Check the credentials of our [email protected] account on https://pypi.org.
2. Type `twine upload dist/*`
3. Enter `__token__` for username and your pypi token for password.

6. Create a fresh virtual environment and install the release candidate version of the package
```bash
pip install oemof-tabular-plugins==X.Y.Zrci
```
Then try to run an example file (for the moment you could try `python examples/scripts/compute.py` from the root of this repository)

7. If you notice errors in the uploaded package, fix them and bump up `rc1` to `rc2` and repeat steps 3. to 6. until you don't see any more errors.
It is encouraged to make sure step 6.is also performed on a different os than yours (ask a colleague for example)
8. If your release candidate works well, you can now do the actual release on `master`, followed by the release on pypi.org. You can also remove the folder `empty_folder` and its content.
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Introduction
This is to showcase how this repository could be used to complement `oemof-tabular <https://github.com/oemof/oemof-tabular>`_ to add constraints specific to certain uses of it

.. code::
import oemof_tabular_plugin as otp
# one can import the full constraint map
from otp import CONSTRAINT_TYPE_MAP
Expand Down
9 changes: 2 additions & 7 deletions RELEASE_PROCEDURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,6 @@ For a **Patch Release** (Hotfix), start at [section 3](https://github.com/rl-ins
* `📝CITATION.cff`
* Update `version`
* Update `date-released`
* `📝setup.py`
* Update `version`
* Update `download_url` (.../v0.1.0.tar.gz)

▶️ Increase version numbers!

Expand Down Expand Up @@ -160,11 +157,9 @@ If you messed up, remove tags and start again
* Push commits to the `release-*` branch

### 1. 💻 Create and publish package on PyPI
* Navigate to git folder `cd D:\git\github\GROUP\REPO\`
* Create package using `python setup.py sdist`
* Create package using `python -m build`
* Check that file has been created in folder `dist`
* Activate python environment `activate release_py38`
* Upload to PyPI using `twine upload dist/NAME_0.5.1.tar.gz`
* Upload to PyPI using `twine upload dist/*`
* Enter `name` and `password`
* Check on PyPI if release arrived
* Breath three times and smile
Expand Down
12 changes: 6 additions & 6 deletions USERS.cff
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
cff-version: 1.2.0
message: "If you use this software, please leave your name for reference.
message: "If you use this software, please leave your name for reference."
authors:
- family-names: "Hülk"
given-names: "Ludwig"
alias: "@Ludee"
affiliation: "Reiner Lemoine Institut"
orcid: "https://orcid.org/0000-0003-4655-2321"
- family-names: ""
given-names: ""
alias: ""
affiliation: ""
orcid: ""

5 changes: 5 additions & 0 deletions examples/scenarios/test_additional_cost_inputs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Dispatch example for oemof-tabular

Run `scripts/infer.py` from the datapackage root directory to add the
meta data file `datapackage.json` after updating the resources of the
datapackage.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name;type;balanced
test-bus-1;bus;true
test-bus-2;bus;true
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name;type;carrier;tech;capacity;capacity_cost;marginal_cost;carrier_cost;efficiency;from_bus;to_bus;expandable;capex;opex_fix;lifetime
test-conv;conversion;conv;conv;0;9.72;1;1;1;test-bus-1;test-bus-2;True;100;1;20
test-conv-2;conversion;conv;conv;0;14.08;1;1;1;test-bus-1;test-bus-2;True;150;1;20
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name;type;carrier;tech;capacity;capacity_cost;bus;marginal_cost;carrier_cost;profile;output_parameters;expandable
test-disp;dispatchable;disp;disp;0;0;test-bus-1;0;0;1;"{""custom_attributes"": {""renewable_factor"": 0}}";True
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name;type;bus;marginal_cost
test-excess;excess;test-bus-2;0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name;amount;profile;type;bus
test-demand;100;test-load-profile;load;test-bus-2
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name;type;carrier;tech;bus;marginal_cost;capacity;output_parameters
test-shortage;shortage;shortage;shortage;test-bus-1;100000;0;{}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name;carrier;tech;storage_capacity;storage_capacity_potential;capacity;efficiency;capacity_cost;storage_capacity_cost;marginal_cost;type;bus;invest_relation_output_capacity;invest_relation_input_output;expandable;capex;opex_fix;lifetime
test-batt;electricity;batt;0;100;0;0.92;0;23.59;1.8;storage;re-elec-bus;0.1;1;True;100;10;10
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name;type;carrier;tech;capacity;capacity_cost;bus;marginal_cost;profile;output_parameters;expandable;capex;opex_fix;lifetime
test-vol;volatile;vol;vol;0;16.53;test-bus-1;0;1;"{""custom_attributes"": {""renewable_factor"": 1}}";True;200;2;30
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
timeindex,test-load-profile
2019-01-01T00:00:00Z,1
2019-01-01T01:00:00Z,1
2019-01-01T02:00:00Z,1
2019-01-01T03:00:00Z,1
2019-01-01T04:00:00Z,1
2019-01-01T05:00:00Z,1
2019-01-01T06:00:00Z,1
2019-01-01T07:00:00Z,1
2019-01-01T08:00:00Z,1
2019-01-01T09:00:00Z,1
2019-01-01T10:00:00Z,1
2019-01-01T11:00:00Z,1
2019-01-01T12:00:00Z,1
2019-01-01T13:00:00Z,1
2019-01-01T14:00:00Z,1
2019-01-01T15:00:00Z,1
2019-01-01T16:00:00Z,1
2019-01-01T17:00:00Z,1
2019-01-01T18:00:00Z,1
2019-01-01T19:00:00Z,1
2019-01-01T20:00:00Z,1
2019-01-01T21:00:00Z,1
2019-01-01T22:00:00Z,1
2019-01-01T23:00:00Z,1
Loading

0 comments on commit ceb8445

Please sign in to comment.