Skip to content

Commit

Permalink
Psychrolib 2.1.0 (#32)
Browse files Browse the repository at this point in the history
Bumps the version to 2.1.0 in all src files, adds a changelog and splits the contributing and development notes adding info on default branches and how to release on PiPy.
  • Loading branch information
dmey authored Mar 21, 2019
1 parent 490e026 commit 22b9f3e
Show file tree
Hide file tree
Showing 12 changed files with 93 additions and 68 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
2.1.0
- Add functions to convert between specific humidity and humidity ratio (aka mixing ratio).
- Add functions to convert to dry bulb temperature or humidity ratio from enthalpy.
- Restrict minimum value of humidity ratio to `1e-7`
- Fix bug with `GetTDewPointFromVapPres` not always converging due to discontinuity about the freezing point of water in `GetSatVapPres` formulae.
- General `README.md`/docs improvements.
64 changes: 3 additions & 61 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,66 +8,8 @@ Thank you for considering contributing to PsychroLib. In general, you can contri
- [Versioning](#versioning)


## Report a bug

Before creating bug reports, please check if similar issue have already been reported [here](https://github.com/psychrometrics/psychrolib/issues). If none exist please create a new issue and include as many details as possible using the required template.

## Testing

PsychroLib is automatically tested at each commit using continuous integration. If are looking to run the tests locally, make sure you can satisfy the required prerequisites and dependencies.

### Prerequisites

- A C and Fortran compiler
- Python version 3.6 or greater.
- Node.js 10.x or greater
- Microsoft Excel


### Dependencies

There are a number of dependencies required to run the tests that need to be installed first. From you command prompt, navigate to the `psychrolib` folder and type the following (I assume that pip and python are for version 3.6 or greater):

```
pip install numpy m2r cffi pytest
cd tests/js && npm install
cd ../..
```


### Run

To run the tests, type the following in your command prompt:
If you would like to know more about specific development guidelines, please refer to our [development notes](DEVELOP.md).

## Report a bug

#### Python, C, Fortran
```
python -m pytest -v -s
```


#### JavaScript
```
cd tests/js && npm test
```


#### VBA/Excel
For VBA/Excel, navigate to `tests/vba` and open `test_psychrolib_ip.xlsm` and `test_psychrolib_si.xlsm`. For each file, enable macros and launch the Visual Basic Editor (VBE) (Alt+F11 on Windows). Go to `Edit` and activate the 'Immediate Window' (Alt+F11 on Windows) and click on 'RunAllTests' from the right hand side drop down menu at the top next to '(General)'. But in essence go in the VBA editor, click on RunAllTests, then press on the Run icon or go to 'Run' > 'Run' menu. The results will appear in the 'Immediate Window' at the bottom of the screen.

![VBA/Excel Test](assets/excel_test.png)


## Coding conventions

The followings are minimal guidelines for new contributors aiming to contribute to the source code. To become acquainted with the conventions it may be easier to first read some of the functions already implemented in the language you are interested to contribute to.

- Always use the language-specific syntax except when defining function names where camel case (e.g. `GetTRankineFromTFahrenheit`) is used irrespective of the language.
- Include a clear description of the function, its inputs, outputs and types.
- Include references.
- Write clear and comprehensive tests.


## Versioning

This project uses [semantic versioning](https://semver.org/).
Before creating bug reports, please check if similar issue have already been reported [here](https://github.com/psychrometrics/psychrolib/issues). If none exist please create a new issue and include as many details as possible using the required template.
77 changes: 77 additions & 0 deletions DEVELOP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Development notes

## Coding conventions

The followings are minimal guidelines for new contributors aiming to contribute to the source code. To become acquainted with the conventions it may be easier to first read some of the functions already implemented in the language you are interested to contribute to.

- Always use the language-specific syntax except when defining function names where camel case (e.g. `GetTRankineFromTFahrenheit`) is used irrespective of the language.
- Include a clear description of the function, its inputs, outputs and types.
- Include references.
- Write clear and comprehensive tests.


## Versioning

This project uses [semantic versioning](https://semver.org/).


## Default branches

We use two branches to record the history of the project. The `master` branch stores the official release history while the `develop` branch serves as an integration branch for features and bug fixes. All new releases are tagged with a version number in `master`.


## How to create and upload a new version to PiPy

From the command prompt, navigate to `src/python`. Then you can create and upload a new release with the following commands:

```
python3 setup.py sdist --formats=zip
python3 -m pip install --user --upgrade twine
python3 -m twine upload dist/
```

## Testing

PsychroLib is automatically tested at each commit using continuous integration. If are looking to run the tests locally, make sure you can satisfy the required prerequisites and dependencies.

### Prerequisites

- A C and Fortran compiler
- Python version 3.6 or greater.
- Node.js 10.x or greater
- Microsoft Excel


### Dependencies

There are a number of dependencies required to run the tests that need to be installed first. From you command prompt, navigate to the `psychrolib` folder and type the following (I assume that pip and python are for version 3.6 or greater):

```
pip install numpy m2r cffi pytest
cd tests/js && npm install
cd ../..
```


### Run

To run the tests, type the following in your command prompt:


#### Python, C, Fortran
```
python -m pytest -v -s
```


#### JavaScript
```
cd tests/js && npm test
```


#### VBA/Excel
For VBA/Excel, navigate to `tests/vba` and open `test_psychrolib_ip.xlsm` and `test_psychrolib_si.xlsm`. For each file, enable macros and launch the Visual Basic Editor (VBE) (Alt+F11 on Windows). Go to `Edit` and activate the 'Immediate Window' (Alt+F11 on Windows) and click on 'RunAllTests' from the right hand side drop down menu at the top next to '(General)'. But in essence go in the VBA editor, click on RunAllTests, then press on the Run icon or go to 'Run' > 'Run' menu. The results will appear in the 'Immediate Window' at the bottom of the screen.

![VBA/Excel Test](assets/excel_test.png)

2 changes: 1 addition & 1 deletion src/c/psychrolib.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* PsychroLib (version 2.0.0) (https://github.com/psychrometrics/psychrolib)
* PsychroLib (version 2.1.0) (https://github.com/psychrometrics/psychrolib)
* Copyright (c) 2018 D. Thevenard and D. Meyer for the current library implementation
* Copyright (c) 2017 ASHRAE Handbook — Fundamentals for ASHRAE equations and coefficients
* Licensed under the MIT License.
Expand Down
2 changes: 1 addition & 1 deletion src/c/psychrolib.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PsychroLib(version 2.0.0) (https:// github.com/psychrometrics/psychrolib)
// PsychroLib(version 2.1.0) (https:// github.com/psychrometrics/psychrolib)
// Copyright(c) 2018 D.Thevenard and D.Meyer. Licensed under the MIT License.

/******************************************************************************************************
Expand Down
2 changes: 1 addition & 1 deletion src/fortran/psychrolib.f90
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
! PsychroLib version 2.0.0 (https://github.com/psychrometrics/psychrolib)
! PsychroLib version 2.1.0 (https://github.com/psychrometrics/psychrolib)
! Copyright (c) 2018 D. Thevenard and D. Meyer for the current library implementation
! Copyright (c) 2017 ASHRAE Handbook — Fundamentals for ASHRAE equations and coefficients
! Licensed under the MIT License.
Expand Down
2 changes: 1 addition & 1 deletion src/js/psychrolib.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* PsychroLib (version 2.0.0) (https://github.com/psychrometrics/psychrolib)
* PsychroLib (version 2.1.0) (https://github.com/psychrometrics/psychrolib)
* Copyright (c) 2018 D. Thevenard and D. Meyer for the current library implementation
* Copyright (c) 2017 ASHRAE Handbook — Fundamentals for ASHRAE equations and coefficients
* Licensed under the MIT License.
Expand Down
2 changes: 1 addition & 1 deletion src/python/psychrolib.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# PsychroLib (version 2.0.0) (https://github.com/psychrometrics/psychrolib)
# PsychroLib (version 2.1.0) (https://github.com/psychrometrics/psychrolib)
# Copyright (c) 2018 D. Thevenard and D. Meyer for the current library implementation
# Copyright (c) 2017 ASHRAE Handbook — Fundamentals for ASHRAE equations and coefficients
# Licensed under the MIT License.
Expand Down
2 changes: 1 addition & 1 deletion src/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from distutils.core import setup

setup(name='PsychroLib',
version='2.0.0',
version='2.1.0',
maintainer = 'The PsychroLib Developers',
description='Library of psychrometric functions to calculate thermodynamic properties of air',
author='D. Thevenard and D. Meyer',
Expand Down
2 changes: 1 addition & 1 deletion src/vba/psychrolib.bas
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
' PsychroLib (version 2.0.0) (https://github.com/psychrometrics/psychrolib)
' PsychroLib (version 2.1.0) (https://github.com/psychrometrics/psychrolib)
' Copyright (c) 2018 D. Thevenard and D. Meyer for the current library implementation
' Copyright (c) 2017 ASHRAE Handbook — Fundamentals for ASHRAE equations and coefficients
' Licensed under the MIT License.
Expand Down
Binary file modified tests/vba/test_psychrolib_ip.xlsm
Binary file not shown.
Binary file modified tests/vba/test_psychrolib_si.xlsm
Binary file not shown.

0 comments on commit 22b9f3e

Please sign in to comment.