Skip to content

Commit

Permalink
rename package to trnsystor
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelduchesne committed Feb 12, 2021
1 parent 404e6cb commit 68161ae
Show file tree
Hide file tree
Showing 80 changed files with 332 additions and 332 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# from the environment for the first two.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = pytrnsys
SPHINXPROJ = trnsystor
SOURCEDIR = ./docs
BUILDDIR = _build

Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[![image](https://travis-ci.com/samuelduchesne/pytrnsys.svg?branch=develop)](https://travis-ci.com/samuelduchesne/pytrnsys)
[![image](https://travis-ci.com/samuelduchesne/trnsystor.svg?branch=develop)](https://travis-ci.com/samuelduchesne/trnsystor)

[![image](https://coveralls.io/repos/github/samuelduchesne/pytrnsys/badge.svg?branch=develop)](https://coveralls.io/github/samuelduchesne/pytrnsys?branch=develop)
[![image](https://coveralls.io/repos/github/samuelduchesne/trnsystor/badge.svg?branch=develop)](https://coveralls.io/github/samuelduchesne/trnsystor?branch=develop)

# pytrnsys
# trnsystor

A python scripting language for TRNSYS.

Expand All @@ -12,12 +12,12 @@ specify parameters, connect components together and more throught python code.
## Installation

```python
pip install pytrnsys
pip install trnsystor
```

## Usage

Since TRNSYS 18, type proformas can be exported to XML schemas. *pytrnsys* builds on
Since TRNSYS 18, type proformas can be exported to XML schemas. *trnsystor* builds on
this easy to read data structure to easily create TrnsysModels using the most popular
scripting language in the data science community:
[Python](https://www.economist.com/graphic-detail/2018/07/26/python-is-becoming-the-worlds-most-popular-coding-language).
Expand All @@ -26,7 +26,7 @@ From the xml file of a type proforma, simply create a TrnsysModel object by invo
`from_xml()` constructor:

```python
>>> from pytrnsys import TrnsysModel
>>> from trnsystor import TrnsysModel
>>> xml = "tests/input_files/Type951.xml"
>>> pipe1 = TrnsysModel.from_xml(xml)
```
Expand Down Expand Up @@ -91,15 +91,15 @@ pipe1.connect_to(pipe2, mapping={0:0, 1:1})
## Equations

In the TRNSYS studio, equations are components holding a list of user-defined expressions.
In pytrnsys a similar approach has been taken: the `Equation` class handles the
In trnsystor a similar approach has been taken: the `Equation` class handles the
creation of equations and the [EquationCollection` class handles the block of equations.
Here's an example:

First, create a series of Equation by invoking the [from_expression` constructor. This
allows you to input the equation as a string.

```python
>>> from pytrnsys import Equation, EquationCollection
>>> from trnsystor import Equation, EquationCollection
>>> equa1 = Equation.from_expression("TdbAmb = [011,001]")
>>> equa2 = Equation.from_expression("rhAmb = [011,007]")
>>> equa3 = Equation.from_expression("Tsky = [011,004]")
Expand Down Expand Up @@ -134,7 +134,7 @@ method `.save()`. The Deck object contains the Simulation Cards and the differen
and saving it to file.

```python
>>> from pytrnsys import Deck, ControlCards
>>> from trnsystor import Deck, ControlCards
>>>
>>> control_card = ControlCards.debug_template(). # Specifies a predefined set of control cards. See section bellow.
>>> cdeck = Deck(name="mydeck", control_cards=control_card, author="jovyan")
Expand All @@ -149,14 +149,14 @@ and saving it to file.
### Simulation Cards

The Simulation Cards is a chuck of code that informs TRNSYS of various simulation controls
such as start time end time and time-step. pytrnsys implements many of those
such as start time end time and time-step. trnsystor implements many of those
*Statements* with a series of Statement objects.

For instance, to create simulation cards using default values, simply call the `all()`
constructor:

```python
>>> from pytrnsys import ControlCards
>>> from trnsystor import ControlCards
>>> cc = ControlCards.all()
>>> print(cc)
*** Control Cards
Expand Down
8 changes: 4 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@
import sys

sys.path.insert(0, os.path.abspath("."))
sys.path.insert(0, os.path.abspath("pytrnsys"))
sys.path.insert(0, os.path.abspath("trnsystor"))

# -- Project information -----------------------------------------------------

project = "pytrnsys"
project = "trnsystor"
copyright = "2019, Samuel Letellier-Duchesne"
author = "Samuel Letellier-Duchesne"

# The full version, including alpha/beta/rc tags
import pytrnsys
import trnsystor

version = release = pytrnsys.__version__
version = release = trnsystor.__version__

# -- General configuration ---------------------------------------------------

Expand Down
4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pytrnsys |version|
trnsystor |version|
======================

.. include:: ../README.rst
Expand All @@ -13,7 +13,7 @@ pytrnsys |version|
Indices and tables
==================

.. py:currentmodule:: pytrnsys
.. py:currentmodule:: trnsystor
* :ref:`genindex`
* :ref:`search`
10 changes: 5 additions & 5 deletions docs/reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Reference
Main Classes
------------

.. currentmodule:: pytrnsys
.. currentmodule:: trnsystor
.. autosummary::
:template: autosummary.rst
:nosignatures:
Expand All @@ -25,7 +25,7 @@ Main Classes
Trnsys Statements
-----------------

.. currentmodule:: pytrnsys.statement
.. currentmodule:: trnsystor.statement
.. autosummary::
:template: autosummary.rst
:nosignatures:
Expand All @@ -51,7 +51,7 @@ Trnsys Statements
Helper Classes
--------------

.. currentmodule:: pytrnsys
.. currentmodule:: trnsystor
.. autosummary::
:template: autosummary.rst
:nosignatures:
Expand All @@ -69,7 +69,7 @@ Helper Classes
Collections
-----------

.. currentmodule:: pytrnsys.collections
.. currentmodule:: trnsystor.collections
.. autosummary::
:template: autosummary.rst
:nosignatures:
Expand All @@ -89,7 +89,7 @@ Collections
Utils
-----

.. currentmodule:: pytrnsys.utils
.. currentmodule:: trnsystor.utils
.. autosummary::
:template: autosummary.rst
:nosignatures:
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: pytrnsys
name: trnsystor
channels:
- defaults
dependencies:
Expand Down
2 changes: 1 addition & 1 deletion make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if "%SPHINXBUILD%" == "" (
)
set SOURCEDIR=./docs
set BUILDDIR=_build
set SPHINXPROJ=pytrnsys
set SPHINXPROJ=trnsystor

if "%1" == "" goto help

Expand Down
29 changes: 0 additions & 29 deletions pytrnsys/collections/__init__.py

This file was deleted.

45 changes: 0 additions & 45 deletions pytrnsys/statement/__init__.py

This file was deleted.

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def find_version(*file_paths):
requirements_lines = f.readlines()
dev_requires = [r.strip() for r in requirements_lines]

package = "pytrnsys"
package = "trnsystor"
setup(
name=package,
version=find_version(package, "__init__.py"),
Expand Down
2 changes: 1 addition & 1 deletion tests/input_files/TYPE24.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<TrnsysModel><object>Quantity Integrator</object><author>Contributors are listed in manuals</author><organization>Solar Energy Laboratory, University of Wisconsin-Madison</organization><editor>MKu</editor><creationDate>TRNSYS v7.5</creationDate><modifictionDate>April 2016</modifictionDate><mode>4</mode><validation>8</validation><icon>C:\software\pytrnsys\tests\input_files\Type24.bmp</icon><type>24</type><maxInstance>9999</maxInstance><keywords/><details>This component integrates a series of quantities over a period of time. Each quantity integrator can have up to, but no more than 500 inputs. Type24 is able to reset periodically throughout the simulation either after a specified number of hours or after each month of the year. With the release of TRNSYS 16, Type24 was expanded so that the time between resets could be counted relative to the start time of the simulation or in absolute time. For example, with a 1 hour reset time, relative time resetting, and a simulation start time of 0.5, the integrator will reset at time 1.5, 2.5, 3.5, 4.5, etc. With a 1 hour reset time, absolute time resetting, and a simulation start time of 0.5, the Type24 integrator would reset at time 1.0, 2.0, 3.0, 4.0, etc. Thus the first integration period would not be a full hour.</details><variables><variable><!--parameter-1--><order>1</order><name>Integration period</name><role>parameter</role><dimension>Time</dimension><unit>hr</unit><type>real</type><min>-12</min><max>+Inf</max><boundaries>[ ; ]</boundaries><default>STOP</default><symbol>SN</symbol><definition>The time interval over which the inputs are to be investigated. The outputs are reset to zero after each reset time interval. If the reset time is set to a negative value, then units of months are assumed (if the reset time is set to -2, then the reset time will be two months...)</definition></variable><variable><!--input-1--><order>2</order><name>Input to be integrated</name><role>input</role><dimension>any</dimension><unit>any</unit><type>real</type><min>-Inf</min><max>+Inf</max><boundaries>[ ; ]</boundaries><default>0.0</default><symbol>SN</symbol><definition>Leave the initial value at zero unless you wish to add a constant to the integration results.
<TrnsysModel><object>Quantity Integrator</object><author>Contributors are listed in manuals</author><organization>Solar Energy Laboratory, University of Wisconsin-Madison</organization><editor>MKu</editor><creationDate>TRNSYS v7.5</creationDate><modifictionDate>April 2016</modifictionDate><mode>4</mode><validation>8</validation><icon>C:\software\trnsystor\tests\input_files\Type24.bmp</icon><type>24</type><maxInstance>9999</maxInstance><keywords/><details>This component integrates a series of quantities over a period of time. Each quantity integrator can have up to, but no more than 500 inputs. Type24 is able to reset periodically throughout the simulation either after a specified number of hours or after each month of the year. With the release of TRNSYS 16, Type24 was expanded so that the time between resets could be counted relative to the start time of the simulation or in absolute time. For example, with a 1 hour reset time, relative time resetting, and a simulation start time of 0.5, the integrator will reset at time 1.5, 2.5, 3.5, 4.5, etc. With a 1 hour reset time, absolute time resetting, and a simulation start time of 0.5, the Type24 integrator would reset at time 1.0, 2.0, 3.0, 4.0, etc. Thus the first integration period would not be a full hour.</details><variables><variable><!--parameter-1--><order>1</order><name>Integration period</name><role>parameter</role><dimension>Time</dimension><unit>hr</unit><type>real</type><min>-12</min><max>+Inf</max><boundaries>[ ; ]</boundaries><default>STOP</default><symbol>SN</symbol><definition>The time interval over which the inputs are to be investigated. The outputs are reset to zero after each reset time interval. If the reset time is set to a negative value, then units of months are assumed (if the reset time is set to -2, then the reset time will be two months...)</definition></variable><variable><!--input-1--><order>2</order><name>Input to be integrated</name><role>input</role><dimension>any</dimension><unit>any</unit><type>real</type><min>-Inf</min><max>+Inf</max><boundaries>[ ; ]</boundaries><default>0.0</default><symbol>SN</symbol><definition>Leave the initial value at zero unless you wish to add a constant to the integration results.
The constant added will be the initial value.</definition></variable><variable><!--output-1--><order>3</order><name>Result of integration</name><role>output</role><dimension>any</dimension><unit>any</unit><type>real</type><min>-Inf</min><max>+Inf</max><boundaries>[ ; ]</boundaries><default>0</default><symbol>SN</symbol><definition>The result of the integration of the corresponding input. Output 1will be the result of the integration of Input 1 with respect to time.</definition></variable><variable><!--parameter-2--><order>4</order><name>Relative or absolute start time</name><role>parameter</role><dimension>Dimensionless</dimension><unit>-</unit><type>integer</type><min>0</min><max>1</max><boundaries>[ ; ]</boundaries><default>0</default><symbol>SN</symbol><definition>This parameter controls whether the integration intervals are relative or absolute
0: integrate at time intervals relative to the simulation start time
1: integrate at absolute time intervals
Expand Down
2 changes: 1 addition & 1 deletion tests/input_files/Type106.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<TrnsysModel><object>Simple Aquastat - Heating Mode</object><author>Tim McDowell</author><organization>Thermal Energy System Specialists</organization><editor>TPM</editor><creationDate>2014-5</creationDate><modifictionDate>June 2015</modifictionDate><mode>4</mode><validation>34</validation><icon>C:\software\pytrnsys\tests\input_files\Type106.bmp</icon><type>106</type><maxInstance>9999</maxInstance><keywords><keyword>Thermostat</keyword><keyword>Controller</keyword></keywords><details>A simple aquastat is modeled to output on/off control functions that can be used to control a system that heats a fluid.</details><comment>Simple Aquastat - Heating</comment><variables><variable><!--input-1--><order>1</order><name>Monitoring temperature</name><role>input</role><dimension>Temperature</dimension><unit>C</unit><type>real</type><min>-Inf</min><max>+Inf</max><boundaries>[ ; ]</boundaries><default>20.0</default><symbol>SN</symbol><definition>The temperature of the fluid being monitored by the controller.</definition></variable><variable><!--output-1--><order>2</order><name>Control signal for heating</name><role>output</role><dimension>Dimensionless</dimension><unit>-</unit><type>integer</type><min>0</min><max>1</max><boundaries>[ ; ]</boundaries><default>0</default><symbol>SN</symbol><definition>The control signal for heating:
<TrnsysModel><object>Simple Aquastat - Heating Mode</object><author>Tim McDowell</author><organization>Thermal Energy System Specialists</organization><editor>TPM</editor><creationDate>2014-5</creationDate><modifictionDate>June 2015</modifictionDate><mode>4</mode><validation>34</validation><icon>C:\software\trnsystor\tests\input_files\Type106.bmp</icon><type>106</type><maxInstance>9999</maxInstance><keywords><keyword>Thermostat</keyword><keyword>Controller</keyword></keywords><details>A simple aquastat is modeled to output on/off control functions that can be used to control a system that heats a fluid.</details><comment>Simple Aquastat - Heating</comment><variables><variable><!--input-1--><order>1</order><name>Monitoring temperature</name><role>input</role><dimension>Temperature</dimension><unit>C</unit><type>real</type><min>-Inf</min><max>+Inf</max><boundaries>[ ; ]</boundaries><default>20.0</default><symbol>SN</symbol><definition>The temperature of the fluid being monitored by the controller.</definition></variable><variable><!--output-1--><order>2</order><name>Control signal for heating</name><role>output</role><dimension>Dimensionless</dimension><unit>-</unit><type>integer</type><min>0</min><max>1</max><boundaries>[ ; ]</boundaries><default>0</default><symbol>SN</symbol><definition>The control signal for heating:
1: heating is required
0: heating is not required</definition></variable><variable><!--parameter-1--><order>3</order><name>No. of oscillations permitted</name><role>parameter</role><dimension>Dimensionless</dimension><unit>-</unit><type>integer</type><min>1</min><max>99</max><boundaries>[ ; ]</boundaries><default>5</default><symbol>SN</symbol><definition>The number of oscillations of the controller state allowed in one timestep before the output will be fixed and the solution found. Set to an odd number to allow the controller to
bounce between two control states for successive timesteps.</definition></variable><variable><!--input-2--><order>4</order><name>Heating setpoint</name><role>input</role><dimension>Temperature</dimension><unit>C</unit><type>real</type><min>-Inf</min><max>+Inf</max><boundaries>[ ; ]</boundaries><default>20.0</default><symbol>SN</symbol><definition>The temperature below which heating is commanded.</definition></variable><variable><!--parameter-2--><order>5</order><name>Temperature dead band</name><role>parameter</role><dimension>Temp. Difference</dimension><unit>deltaC</unit><type>real</type><min>-Inf</min><max>+Inf</max><boundaries>[ ; ]</boundaries><default>2.0</default><symbol>SN</symbol><definition>The dead band temperature difference of the controller. In this model, hysteresis effects can be modeled by use of this parameter. This parameter is used to modify the heating setpoint temperature based on the state of this controller at the previous timestep. If hysteresis is not desired for this controller, simply set this parameter to 0.0</definition></variable></variables><cycles/><source>.\SourceCode\Types\Type106.f90</source></TrnsysModel>
2 changes: 1 addition & 1 deletion tests/input_files/Type114.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<modifictionDate>May 2011</modifictionDate>
<mode>2</mode>
<validation>34</validation>
<icon>C:\Users\saleta\Dropbox\Polytechnique\Doc\software\pytrnsys\tests\input_files\Type114.bmp</icon>
<icon>C:\Users\saleta\Dropbox\Polytechnique\Doc\software\trnsystor\tests\input_files\Type114.bmp</icon>
<type>114</type>
<maxInstance>9999</maxInstance>
<keywords>
Expand Down
2 changes: 1 addition & 1 deletion tests/input_files/Type11f.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<modifictionDate>May 2011</modifictionDate>
<mode>4</mode>
<validation>32</validation>
<icon>C:\Users\saleta\Dropbox\Polytechnique\Doc\software\pytrnsys\tests\input_files\Type11f.bmp</icon>
<icon>C:\Users\saleta\Dropbox\Polytechnique\Doc\software\trnsystor\tests\input_files\Type11f.bmp</icon>
<type>11</type>
<maxInstance>9999</maxInstance>
<keywords/>
Expand Down
2 changes: 1 addition & 1 deletion tests/input_files/Type11h.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<modifictionDate>May 2011</modifictionDate>
<mode>4</mode>
<validation>32</validation>
<icon>C:\Users\saleta\Dropbox\Polytechnique\Doc\software\pytrnsys\tests\input_files\Type11h.bmp</icon>
<icon>C:\Users\saleta\Dropbox\Polytechnique\Doc\software\trnsystor\tests\input_files\Type11h.bmp</icon>
<type>11</type>
<maxInstance>9999</maxInstance>
<keywords/>
Expand Down
Loading

0 comments on commit 68161ae

Please sign in to comment.