Skip to content

Commit

Permalink
Merge pull request #29 from abhishekvraman/maha_dev
Browse files Browse the repository at this point in the history
Added Classes for Measurement. Updated Series as a seprate module.
  • Loading branch information
abhishekvraman authored May 24, 2024
2 parents 34c464a + ccc6d55 commit cb19547
Show file tree
Hide file tree
Showing 35 changed files with 1,109 additions and 593 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
git clone https://github.com/abhishekvraman/Propylean.git
cd Propylean
python -m build
python -m pip install dist/propylean-0.2.5-py3-none-any.whl
python -m pip install dist/propylean-0.2.6-py3-none-any.whl
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2023, 2022, 2021 Abhishek Venkitta Raman
Copyright (c)2024, 2023, 2022, 2021 Abhishek Venkitta Raman

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
50 changes: 34 additions & 16 deletions Models/LPG_bullet_analysis.ipynb

Large diffs are not rendered by default.

29 changes: 20 additions & 9 deletions Models/pump_circuit.ipynb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"id": "c98d186c",
"metadata": {},
Expand Down Expand Up @@ -32,12 +33,12 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Material Stream Tag: Water 0\n",
"Material Stream Tag: Water 1\n",
"Material Stream Tag: Water 2\n",
"Material Stream Tag: Water 3\n",
"Material Stream Tag: Water 4\n",
"Material Stream Tag: Water 5\n"
"Material Stream with tag: Water 0\n",
"Material Stream with tag: Water 1\n",
"Material Stream with tag: Water 2\n",
"Material Stream with tag: Water 3\n",
"Material Stream with tag: Water 4\n",
"Material Stream with tag: Water 5\n"
]
}
],
Expand Down Expand Up @@ -118,6 +119,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "098cf610",
"metadata": {},
Expand Down Expand Up @@ -150,6 +152,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "01428f74",
"metadata": {},
Expand Down Expand Up @@ -180,6 +183,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "6223f571",
"metadata": {},
Expand Down Expand Up @@ -264,6 +268,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "6e55a763",
"metadata": {},
Expand Down Expand Up @@ -294,6 +299,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "a2f94a64",
"metadata": {},
Expand Down Expand Up @@ -346,6 +352,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "68626db0",
"metadata": {},
Expand Down Expand Up @@ -376,6 +383,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "cbcc786e",
"metadata": {},
Expand Down Expand Up @@ -434,6 +442,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "080702ed",
"metadata": {},
Expand Down Expand Up @@ -464,6 +473,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "eedc8eb9",
"metadata": {},
Expand Down Expand Up @@ -514,6 +524,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "242284cc",
"metadata": {},
Expand Down Expand Up @@ -553,7 +564,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\VijayaShree\\Documents\\Abhishek\\Propylean\\src\\propylean\\properties.py:87: UserWarning: Time series of the property is not set. Series attribute is considerd using 'value', 'max_val', or 'min_val' if provided.\n",
"C:\\Users\\AVRaman\\Documents\\Codes\\Propylean\\src\\propylean\\properties.py:89: UserWarning: Time series of the property is not set. Series attribute is considerd using 'value', 'max_val', or 'min_val' if provided.\n",
" warn(\"Time series of the property is not set. Series attribute is considerd using 'value', 'max_val', or 'min_val' if provided.\")\n"
]
},
Expand All @@ -575,7 +586,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -589,7 +600,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.1"
"version": "3.10.0"
},
"vscode": {
"interpreter": {
Expand Down
Binary file not shown.
Binary file added project_resources/rd-te-r06202-008.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = propylean
version = 0.2.5
version = 0.2.6
author = Abhishek V Raman
author_email =
description = The open-source calculations and analytics package for chemical process industries.
Expand Down
26 changes: 6 additions & 20 deletions src/propylean/equipments/abstract_equipment_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,8 @@ def __init__(self, **inputs) -> None:
Type: str
Acceptable values: Any string type
Default value: None
Description: Equipment tag the user wants to provide. If not provided, then tag is automatically generated
dynamic_state:
Required: No
Type: bool
Acceptable values: True or False
Default value: False
Description: If equipment is in dynamic state and inventory is changing.
TODO: Provide dynamic simulation capabilities.
Description: Equipment tag the user wants to provide. If not provided, then tag is automatically generated.
pressure_drop:
Required: No
Type: int or float (recommended)
Expand All @@ -54,15 +46,12 @@ def __init__(self, **inputs) -> None:
>>> class NewEquipment(_EquipmentOneInletOutlet):
......
"""
if 'tag' not in inputs:
self.tag = self._create_equipment_tag()
else:
self.tag = inputs['tag']
self.dynamic_state = False if 'dynamic_state' not in inputs else False
self.tag = inputs.pop('tag', self._create_equipment_tag())

#Flow properties
self._inlet_mass_flowrate = prop.MassFlowRate()
self._outlet_mass_flowrate = prop.MassFlowRate()
self._inventory_change_rate = prop.MassFlowRate()
self.design_flowrate = prop.MassFlowRate()

#Pressure properties
Expand Down Expand Up @@ -280,13 +269,10 @@ def outlet_mass_flowrate(self, value):
@property
def inventory_change_rate(self):
self = self._get_equipment_object(self)
if not self.dynamic_state:
return prop.MassFlowRate(0, self.inlet_mass_flowrate.unit)
return self._inlet_mass_flowrate - self._outlet_mass_flowrate
return self._inventory_change_rate
@inventory_change_rate.setter
def inventory_change_rate(self, value):
raise Exception("Dynamic process is not yet supported.")
_Validators.validate_arg_prop_value_type("inventory_change_rate", value, (int))
_Validators.validate_arg_prop_value_type("inventory_change_rate", value, (int, float, prop.MassFlowRate))
self = self._get_equipment_object(self)
value, unit = self._tuple_property_value_unit_returner(value, prop.MassFlowRate)
if unit is None:
Expand Down
Loading

0 comments on commit cb19547

Please sign in to comment.