tespy icon indicating copy to clipboard operation
tespy copied to clipboard

[enhancement] Add units to ComponentProperties container

Open BenPortner opened this issue 2 years ago • 4 comments

Dear Tespy developers,

first of all, thanks for developing Tespy! I am only a beginner but I already feel like it will become a valuable part of my research.

Problem description

Right now it is not immediately clear, which units some of the outputs have. The documentation clearly states that SI units will be used if not otherwise specified during creation of the Network object. However, I think it is better to be explicit than implicit.

Proposed solution

You already have a container object which stores calculated fluid properties (ComponentProperties). Why not add the units? E.g.:

compressor.P.val # this returns the value, e.g. 9000
compressor.P.unit # this returns the unit e.g. W

I think this would facilitate the interpretation of the results a great bit, especially for beginners like me.

BenPortner avatar Apr 28 '22 12:04 BenPortner

Dear @BenPortner,

I am pleased to hear, that you are interested in using TESPy, thank you for reaching out and pointing to this issue.

A proper unit system should definitely be set up for the component properties as well some time in the future. Unfortunately, I am currently only working on TESPy in my free time, so these kind of things do take more time.

I had an idea already somewhere in my mind, where the network class covers general unit systems, like power, heat, length, … and the component properties will have the information which of the units is applicable. Then add a process in pre and postprocessing converting from and to SI. I‘ll put this on my todo list :).

If you have something in mind, please let me know!

Appart from that, a major overhaul of the software would be quite nice I feel.

Best regards

Francesco

fwitte avatar Apr 28 '22 15:04 fwitte

I also started a very low effort collection of ideas for package restructuring: https://github.com/oemof/tespy/issues/295

If you have any architectural design ideas etc. you would like to see changed, you can also comment there.

fwitte avatar Apr 28 '22 16:04 fwitte

I made a quick and dirty unit conversion for components in my latest commit IPUdk/tespy@640a77b7ffd147b19638fe027dc79019ebac0410

kaern avatar Dec 13 '23 12:12 kaern

@kaern! Thanks a lot for your start on this, I will put this on my schedule for the holiday season. I really would like to get your developments merged!

Have a good night!

fwitte avatar Dec 13 '23 20:12 fwitte