ganessa


Nameganessa JSON
Version 2.4.0 PyPI version JSON
download
home_page
SummaryPython interface to Piccolo/Ganessa_SIM and Picalor simulation kernel
upload_time2024-01-16 07:54:23
maintainer
docs_urlNone
authorDr. Pierre Antoine Jarrige
requires_python>=3.5, <4
licensecommercial
keywords piccolo picalor ganessa
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Piccolo5/Piccolo6/Picalor6 and Ganessa_SIM API python calling interface

What is it?
-----------
A python package enabling users to call a set of Picwin32.dll or Ganessa_SIM.dll API functions and subroutines within python scripts. Initially provided for python 2.7 32 bits only. 1.9.x versions served as python 3.5 / 3.6 pre-release.

Starting with version 2.0.0, the wheel package is provided for 32 bits version for python 2.7 / 3.5 / 3.6 / 3.7 (Piccolo kernel is a 32 bits application) and 64 bits version for python 3.6 / 3.7 (Ganessa_SIM is available as 32 and 64 bits).

Starting with version 2.1.0, the wheel package is provided for 32 bits version for python 2.7 / 3.7 / 3.8 (Piccolo kernel is a 32 bits application) and 64 bits version for python 3.7 / 3.8 (Ganessa_SIM is available as 32 and 64 bits).

Starting with version 2.1.8, the wheel package is provided for 32 bits version for python 2.7 / 3.7 / 3.8 / 3.9 (Piccolo kernel is a 32 bits application) and 64 bits version for python 3.7 / 3.8 / 3.9 (Ganessa_SIM is available as 32 and 64 bits).

Version 2.1.9 is the last version that supported python 2.7.
Version 2.2.4 is the last version for which a wheel is provided for python 3.7.

Starting with version 2.2.5, the wheel package is provided for 32 bits version for python 3.8 / 3.9 / 3.10 (Piccolo kernel is a 32 bits application) and 64 bits version for python 3.8 / 3.9 / 3.10 (Ganessa_SIM is available as 32 and 64 bits).

Starting with version 2.3.3, the wheel package is provided for 32 bits version for python 3.8 / 3.9 / 3.10 / 3.11 (Piccolo kernel is a 32 bits application) and 64 bits version for python 3.8 / 3.9 / 3.10 / 3.11 (Ganessa_SIM is available as 32 and 64 bits).

Starting with version 2.3.10, the wheel package is provided for 32 bits version for python 3.8 / 3.9 / 3.10 / 3.11 / 3.12 (Piccolo kernel is a 32 bits application) and 64 bits version for python 3.8 / 3.9 / 3.10 / 3.11 / 3.12 (Ganessa_SIM is available as 32 and 64 bits).

Installation
------------
*Windows only* :: 

    pip install ganessa

Obsolete Requirements (32 bits)
-------------------------------
  #) python 2.7, 3.5, 3.6, 3.7
  #) obsolete python requirements: numpy 1.11 or above (python 2.7) / numpy 1.13.1 or above (python 3.5 - 3.6) / numpy 1.15.1 (python 3.7)
  #) Piccolo or Picalor kernel library (picwin32.dll), starting from version 5 (141203) for python 2.7
  #) valid Piccolo or Picalor or Ganessa_SIM license

Requirements (32 bits)
----------------------
  #) python 3.8 or 3.9 or 3.10 or 3.11 or 3.12
  #) numpy 1.15.1 (python 3.8) / numpy 1.19.4 (python 3.9) / numpy 1.21.3 (python 3.10) / numpy 1.23.3 (python 3.11+)
  #) Piccolo6 or Picalor6 kernel library (picwin32.dll), or recent Ganessa_SIM.dll.
     Note that a recent (2020 or newer) version of Piccolo kernel is required for use with python 3.12
  #) valid Piccolo or Picalor or Ganessa_SIM license (for commercial releases)

Requirements (64 bits)
----------------------
  #) python 3.8 or 3.9 or 3.10 or 3.11
  #) numpy 1.15.1 (python 3.8) / numpy 1.19.4 (python 3.9) / numpy 1.21.3 (python 3.10) / numpy 1.23.3 (python 3.11)
  #) recent Ganessa_SIM_x64.dll (64 bit dll)
  #) valid Ganessa_SIM license (for commercial releases)


This tool expects Picwin32.dll to be in the PATH or in one of the following folders::

                 %localappdata%/Programs/Safege/Piccolo_ or
                 %localappdata%/Programs/Suez/Piccolo_ or
                 %localappdata%/Programs/Gfi Progiciels/Piccolo6_ or
                 %localappdata%/Programs/Inetum/Piccolo6_ or
 [[E: or D:] or C:] / [
                 'Program Files (x86)/Safege/Piccolo6_' or
                 'Program Files (x86)/Gfi Progiciels/Piccolo6_'  or
                 'Program Files (x86)/Inetum/Piccolo6_'  or
                 'Program Files (x86)/Gfi Progiciels/Picalor6_' or
                 'Program Files/Adelior/Piccolo5_'
                ]
              + ['fr' or 'uk' or 'esp' or 'eng'] + ['' or '_ck']

Or one of Ganessa_SIM.dll or Ganessa_TH.dll or Ganessa_SIM_x64.dll in::

            '%localappdata%/Programs/Safege/Ganessa_ or
            '%localappdata%/Programs/Suez/Ganessa_ or
 [[E: or D:] or C:] /Program Files (x86)/Safege/Ganessa_'
              + ['fr' or 'uk' or 'esp' or 'eng']

With custom installations, PICCOLO_DIR or GANESSA_DIR environment variables can be set to define the path. 

Content
-------

The package provides:
 #) 'sim' package:
     - a few basic functions for reading or loading a model, running hydraulic and WQ simulations.
     - 'getter' functions for individual objects and attributes, time series vectors, attribute vector of all object (attribute maps).
     - iterators over links, nodes, tanks, demands, and tables, or over Piccolo command language selections.
     - a Graph class built from the current model graph, with propagation functions.
     - almost no 'setter' functions, but 'cmd', 'execute' and 'cmdfile' any Piccolo command language instruction(s)/file.
 #) 'th' package: same functions for Picalor except running extended period simulations and time series getters.
 #) 'util' package: conversion and formatting and other miscellaneous functions.
 #) 'OpenFileMMI' provides classes for opening dialog frame for a .dat/.bin/.pic/.inp model file (see en2emu below), folder, and input/output (result) file. It should be imported after 'sim' or 'th'.
 #) 'plot' provides easy multiple simulation vs reference graphs plot settings - requires matplotlib.
 #) 'proj' provides a 'guess_proj' function returning the model CRS as EPSG:xxxx or mnemonic, and 'get_spatial_ref'
 #) 'sort' provides a heapsort based on heapq.
 #) 'midfile' provides minimal mif/mid functions similar to shp/dbf shapefile handler (pyshp package).
 #) 'geojsonfile' provides minimal geojson functions similar to shp/dbf shapefile handler (pyshp package).
 #) 'epanet2' provides limited epanet2.0.12 python API for win32 (thanks to Assela Pathirana - mailto: assela@pathirana.net) similar to EpanetTools-0.4.2; with epanet.getlinknodes and calculation of tank diameter corrected (from 0.9.2 and 1.0.0).
 #) 'epanet22' provides a single threaded, low-level python API for epanet2.2, equivalent/compatible with above epanet2.
 #) 'owa_epanet22' provides an EpanetTools compatibility layer for owa-epanet 2.2.3/2.3.4: it defines EN_XXX constants and single project ENxxx API functions. All owa-epanet API functions are available.
 #) 'en2emu' provides minimal 'sim' compatibility for Epanet models being opened with OpenFileMMI.SelectModel, wrapper functions for running hydraulic and WQ simulations and collecting results as numpy arrays, iterators etc. See the doc.
 #) 'parallel' provides a simple parallel simulations handling framework based on multiprocessing, returning either elementary or reduced results.

Model objects and parameters can be modified using Piccolo command language (see cmd, cmdfile and execute).

Recently introduced functions and classes may not be functional with old versions of Piccolo / Ganessa_SIM kernel.

Documentation
-------------
Documentation is provided as pyGanessa.html in the installation folder, possibly in docs subfolder. It includes package history.

History of the README document
------------------------------
 - Created 2013-07-04
 - Revised 2015-05-03: since 2014-12-04 Picwin32.dll is compatible with this API.
 - Revised 2016-07-07: provided as .rst.
 - Revised 2017-08-08: install using pip; Piccolo/Ganessa dll folder search order.
 - Revised 2017-09-12: split sim into core, core_sim, core_th.
 - Revised 2017-11-13: added sort, midfile, epanet2 modules.
 - Revised 2017-11-30: added parallel.
 - Revised 2018-03-29: minor changes / extension to python 3.5-3.6.
 - Revised 2018-06-08: OpenFileMMI and epanet2 details, added example.
 - Revised 2018-08-16: 64 bits compatibility (Ganessa_SIM and python 3.7 / 3.8 only).
 - Revised 2018-08-27: numpy requirements.
 - Revised 2019-09-13: minor changes.
 - Revised 2019-10-09: extension to python 3.8.
 - Revised 2019-10-15: README rst fix.
 - Revised 2020-02-05: added sim.Graph; README rst fix.
 - Revised 2020-11-20: README rst fix.
 - Revised 2021-04-29: extension to python 3.9.
 - Revised 2021-06-17: python 2.7 compatibility removed since 2.2.0; folder lookup paths.
 - Revised 2021-10-27: python 3.7 removed & python 3.10 added since 2.2.5.
 - Revised 2022-04-21: dll lookup order as E:, D:, C:; example updated.
 - Revised 2022-09-27: python 3.11 added; proj package added.
 - Revised 2023-07-12: added epanet22.
 - Revised 2023-08-10: added owa_epanet22.
 - Revised 2023-10-18: added en2emu.
 - Revised 2023-11-06: added python 3.12.

Example
-------

::

 """Example program for ganessa
 requires a Piccolo model 'model.dat' in the current folder"""
 
 import os
 
 import matplotlib.pyplot as plt
 
 import ganessa.sim as pic
 
 # This code sample runs under python 3.8 - 3.10
 # but requires ganessa 2.3.0 or higher
 
 if __name__ == "__main__":
     wkfold = os.path.dirname(__file__)
     if not wkfold:
         wkfold = os.getcwd()
         print("Current folder is:", wkfold)
     os.chdir(wkfold)
     # will create work files here
     pic.init(wkfold)
     # loads the model - change the name here...
     pic.cmdfile("model.dat")
     # select small pipe (diameter below 155)
     # using iterator and D getter, by id
     def pipefilter(diameter):
         return 0 < diameter < 155
     pipes = [p for p in pic.Links() if pipefilter(pic.linkattr(p, "D"))]
     # using iterator and D getter, by index (less concise but slightly faster)
     pipes = [
         pic.getid(pic.LINK, k)
         for k in range(1, pic.nbobjects(pic.LINK) + 1)
         if pipefilter(pic.nlinkattr(k, "D"))
     ]
     # Most Piccoloic, using (french) command language selection
     pic.setlang("French")
     # Selectid has been introduced in 2.3.0; it is equivalent to Selected(..., False)
     pipes = list(pic.Selectid("TUYAU (D < 155) FIN"))
     # minimal setter functions for links, nodes, tanks attributes
     pid = pipes[len(pipes) // 2]
     diam = pic.linkattr(pid, "D")
     pic.setlinkattr(pid, "D", diam * 2)
     # language-independant commands: MODIF MULT D 2 ARC {pid} FIN
     KWEND = pic.getkeyword(pic.DICT.END)
     pic.gencmdw(pic.M.MOD, pic.M.MOD.MULT, pic.M.NONE, "D 2")
     pic.gencmd(pic.M.LNK, pic.M.LNK.NONE, pic.M.NONE, pid + " " + KWEND, 1)
     # Use command language to set / modify / delete objects
     pic.execute("MODIF", f"DETR ARC {pid} FIN")
     pic.execute("MODIF", "FUSION NOEU (AA = 1) FIN", "FUSION NOEU (AA = 1) FIN")
     # or change parameters
     pic.execute("SIMUL", "CRITX 0.05", "MXITER 75")
     # get demand profile TS
     nb = pic.tsdemandlen("DEFAUT", "HAUT")
     print("Profile length for area HAUT:", nb)
     res = pic.tsdemand("DEFAUT", "HAUT")
     # Unlike epanet, first run simulation then browse/ query results
     pic.full_solveH(silent=True, retry=True)
     print("Simulation done.")
     pic.browseH(3600 * 8.5)
     fig = plt.figure(figsize=(16 - 1, 9 - 1))
     # plot 3D elevation and hydraulic head
     ax = fig.add_subplot(projection="3d")
     for a in pic.Links():
         x, y, z, v, nb = pic.linkXYZV(a, "CH")
         if nb > 0:
             ax.plot(x, y, z, "r-")
             ax.plot(x, y, v, "b-")
     plt.title("Plan de charge a t= 08:30")
     plt.show()
     # print min/max pressure over the EPS
     attr = "P"
     minpax_p = list(pic.getMinMax(pic.NODE, attr))
     for nid, vmin, vmax, vmoy in minpax_p[:10]:
         print(nid, attr + "min:", vmin, attr + "max:", vmax)
     print("\t...")
     for nid, vmin, vmax, vmoy in minpax_p[-10:]:
         print(nid, attr + "min:", vmin, attr + "max:", vmax)
     # get current volume simulation (internal variable steps) and measurement TS
     for tid in pic.Tanks():
         t1, v1, nb1 = pic.tsval(pic.TANK, tid, "VC")
         t2, v2, nb2 = pic.msval(pic.TANK, tid, "VC")
     # get current volume simulation results at measurement sampling
     for tid in pic.Tanks():
         t3, v3, nb3 = pic.tsvalbymts(pic.TANK, tid, "VC")
     # export as Epanet .inp
     pic.exportEpanet("model.inp")
     pic.execute("XXMEM ARC : D")
     pic.savemodel("model_xx.dat", extra_data=[("ARC (D > 149) FIN", "XX")])
     # WQ source data optional argument is a specific node - not used here
     print("\nWQ source data (input forcing and TS at nodes):")
     for n, cd, attr, t, c, nb in pic.WQSources():
         print(n, cd, attr, nb, t, c)
     print("Done.")
     # use reset() for switching model, close() to terminate
     pic.close()




            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "ganessa",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.5, <4",
    "maintainer_email": "",
    "keywords": "Piccolo Picalor Ganessa",
    "author": "Dr. Pierre Antoine Jarrige",
    "author_email": "ganessa@safege.fr",
    "download_url": "",
    "platform": null,
    "description": "Piccolo5/Piccolo6/Picalor6 and Ganessa_SIM API python calling interface\n\nWhat is it?\n-----------\nA python package enabling users to call a set of Picwin32.dll or Ganessa_SIM.dll API functions and subroutines within python scripts. Initially provided for python 2.7 32 bits only. 1.9.x versions served as python 3.5 / 3.6 pre-release.\n\nStarting with version 2.0.0, the wheel package is provided for 32 bits version for python 2.7 / 3.5 / 3.6 / 3.7 (Piccolo kernel is a 32 bits application) and 64 bits version for python 3.6 / 3.7 (Ganessa_SIM is available as 32 and 64 bits).\n\nStarting with version 2.1.0, the wheel package is provided for 32 bits version for python 2.7 / 3.7 / 3.8 (Piccolo kernel is a 32 bits application) and 64 bits version for python 3.7 / 3.8 (Ganessa_SIM is available as 32 and 64 bits).\n\nStarting with version 2.1.8, the wheel package is provided for 32 bits version for python 2.7 / 3.7 / 3.8 / 3.9 (Piccolo kernel is a 32 bits application) and 64 bits version for python 3.7 / 3.8 / 3.9 (Ganessa_SIM is available as 32 and 64 bits).\n\nVersion 2.1.9 is the last version that supported python 2.7.\nVersion 2.2.4 is the last version for which a wheel is provided for python 3.7.\n\nStarting with version 2.2.5, the wheel package is provided for 32 bits version for python 3.8 / 3.9 / 3.10 (Piccolo kernel is a 32 bits application) and 64 bits version for python 3.8 / 3.9 / 3.10 (Ganessa_SIM is available as 32 and 64 bits).\n\nStarting with version 2.3.3, the wheel package is provided for 32 bits version for python 3.8 / 3.9 / 3.10 / 3.11 (Piccolo kernel is a 32 bits application) and 64 bits version for python 3.8 / 3.9 / 3.10 / 3.11 (Ganessa_SIM is available as 32 and 64 bits).\n\nStarting with version 2.3.10, the wheel package is provided for 32 bits version for python 3.8 / 3.9 / 3.10 / 3.11 / 3.12 (Piccolo kernel is a 32 bits application) and 64 bits version for python 3.8 / 3.9 / 3.10 / 3.11 / 3.12 (Ganessa_SIM is available as 32 and 64 bits).\n\nInstallation\n------------\n*Windows only* :: \n\n    pip install ganessa\n\nObsolete Requirements (32 bits)\n-------------------------------\n  #) python 2.7, 3.5, 3.6, 3.7\n  #) obsolete python requirements: numpy 1.11 or above (python 2.7) / numpy 1.13.1 or above (python 3.5 - 3.6) / numpy 1.15.1 (python 3.7)\n  #) Piccolo or Picalor kernel library (picwin32.dll), starting from version 5 (141203) for python 2.7\n  #) valid Piccolo or Picalor or Ganessa_SIM license\n\nRequirements (32 bits)\n----------------------\n  #) python 3.8 or 3.9 or 3.10 or 3.11 or 3.12\n  #) numpy 1.15.1 (python 3.8) / numpy 1.19.4 (python 3.9) / numpy 1.21.3 (python 3.10) / numpy 1.23.3 (python 3.11+)\n  #) Piccolo6 or Picalor6 kernel library (picwin32.dll), or recent Ganessa_SIM.dll.\n     Note that a recent (2020 or newer) version of Piccolo kernel is required for use with python 3.12\n  #) valid Piccolo or Picalor or Ganessa_SIM license (for commercial releases)\n\nRequirements (64 bits)\n----------------------\n  #) python 3.8 or 3.9 or 3.10 or 3.11\n  #) numpy 1.15.1 (python 3.8) / numpy 1.19.4 (python 3.9) / numpy 1.21.3 (python 3.10) / numpy 1.23.3 (python 3.11)\n  #) recent Ganessa_SIM_x64.dll (64 bit dll)\n  #) valid Ganessa_SIM license (for commercial releases)\n\n\nThis tool expects Picwin32.dll to be in the PATH or in one of the following folders::\n\n                 %localappdata%/Programs/Safege/Piccolo_ or\n                 %localappdata%/Programs/Suez/Piccolo_ or\n                 %localappdata%/Programs/Gfi Progiciels/Piccolo6_ or\n                 %localappdata%/Programs/Inetum/Piccolo6_ or\n [[E: or D:] or C:] / [\n                 'Program Files (x86)/Safege/Piccolo6_' or\n                 'Program Files (x86)/Gfi Progiciels/Piccolo6_'  or\n                 'Program Files (x86)/Inetum/Piccolo6_'  or\n                 'Program Files (x86)/Gfi Progiciels/Picalor6_' or\n                 'Program Files/Adelior/Piccolo5_'\n                ]\n              + ['fr' or 'uk' or 'esp' or 'eng'] + ['' or '_ck']\n\nOr one of Ganessa_SIM.dll or Ganessa_TH.dll or Ganessa_SIM_x64.dll in::\n\n            '%localappdata%/Programs/Safege/Ganessa_ or\n            '%localappdata%/Programs/Suez/Ganessa_ or\n [[E: or D:] or C:] /Program Files (x86)/Safege/Ganessa_'\n              + ['fr' or 'uk' or 'esp' or 'eng']\n\nWith custom installations, PICCOLO_DIR or GANESSA_DIR environment variables can be set to define the path. \n\nContent\n-------\n\nThe package provides:\n #) 'sim' package:\n     - a few basic functions for reading or loading a model, running hydraulic and WQ simulations.\n     - 'getter' functions for individual objects and attributes, time series vectors, attribute vector of all object (attribute maps).\n     - iterators over links, nodes, tanks, demands, and tables, or over Piccolo command language selections.\n     - a Graph class built from the current model graph, with propagation functions.\n     - almost no 'setter' functions, but 'cmd', 'execute' and 'cmdfile' any Piccolo command language instruction(s)/file.\n #) 'th' package: same functions for Picalor except running extended period simulations and time series getters.\n #) 'util' package: conversion and formatting and other miscellaneous functions.\n #) 'OpenFileMMI' provides classes for opening dialog frame for a .dat/.bin/.pic/.inp model file (see en2emu below), folder, and input/output (result) file. It should be imported after 'sim' or 'th'.\n #) 'plot' provides easy multiple simulation vs reference graphs plot settings - requires matplotlib.\n #) 'proj' provides a 'guess_proj' function returning the model CRS as EPSG:xxxx or mnemonic, and 'get_spatial_ref'\n #) 'sort' provides a heapsort based on heapq.\n #) 'midfile' provides minimal mif/mid functions similar to shp/dbf shapefile handler (pyshp package).\n #) 'geojsonfile' provides minimal geojson functions similar to shp/dbf shapefile handler (pyshp package).\n #) 'epanet2' provides limited epanet2.0.12 python API for win32 (thanks to Assela Pathirana - mailto: assela@pathirana.net) similar to EpanetTools-0.4.2; with epanet.getlinknodes and calculation of tank diameter corrected (from 0.9.2 and 1.0.0).\n #) 'epanet22' provides a single threaded, low-level python API for epanet2.2, equivalent/compatible with above epanet2.\n #) 'owa_epanet22' provides an EpanetTools compatibility layer for owa-epanet 2.2.3/2.3.4: it defines EN_XXX constants and single project ENxxx API functions. All owa-epanet API functions are available.\n #) 'en2emu' provides minimal 'sim' compatibility for Epanet models being opened with OpenFileMMI.SelectModel, wrapper functions for running hydraulic and WQ simulations and collecting results as numpy arrays, iterators etc. See the doc.\n #) 'parallel' provides a simple parallel simulations handling framework based on multiprocessing, returning either elementary or reduced results.\n\nModel objects and parameters can be modified using Piccolo command language (see cmd, cmdfile and execute).\n\nRecently introduced functions and classes may not be functional with old versions of Piccolo / Ganessa_SIM kernel.\n\nDocumentation\n-------------\nDocumentation is provided as pyGanessa.html in the installation folder, possibly in docs subfolder. It includes package history.\n\nHistory of the README document\n------------------------------\n - Created 2013-07-04\n - Revised 2015-05-03: since 2014-12-04 Picwin32.dll is compatible with this API.\n - Revised 2016-07-07: provided as .rst.\n - Revised 2017-08-08: install using pip; Piccolo/Ganessa dll folder search order.\n - Revised 2017-09-12: split sim into core, core_sim, core_th.\n - Revised 2017-11-13: added sort, midfile, epanet2 modules.\n - Revised 2017-11-30: added parallel.\n - Revised 2018-03-29: minor changes / extension to python 3.5-3.6.\n - Revised 2018-06-08: OpenFileMMI and epanet2 details, added example.\n - Revised 2018-08-16: 64 bits compatibility (Ganessa_SIM and python 3.7 / 3.8 only).\n - Revised 2018-08-27: numpy requirements.\n - Revised 2019-09-13: minor changes.\n - Revised 2019-10-09: extension to python 3.8.\n - Revised 2019-10-15: README rst fix.\n - Revised 2020-02-05: added sim.Graph; README rst fix.\n - Revised 2020-11-20: README rst fix.\n - Revised 2021-04-29: extension to python 3.9.\n - Revised 2021-06-17: python 2.7 compatibility removed since 2.2.0; folder lookup paths.\n - Revised 2021-10-27: python 3.7 removed & python 3.10 added since 2.2.5.\n - Revised 2022-04-21: dll lookup order as E:, D:, C:; example updated.\n - Revised 2022-09-27: python 3.11 added; proj package added.\n - Revised 2023-07-12: added epanet22.\n - Revised 2023-08-10: added owa_epanet22.\n - Revised 2023-10-18: added en2emu.\n - Revised 2023-11-06: added python 3.12.\n\nExample\n-------\n\n::\n\n \"\"\"Example program for ganessa\n requires a Piccolo model 'model.dat' in the current folder\"\"\"\n \n import os\n \n import matplotlib.pyplot as plt\n \n import ganessa.sim as pic\n \n # This code sample runs under python 3.8 - 3.10\n # but requires ganessa 2.3.0 or higher\n \n if __name__ == \"__main__\":\n     wkfold = os.path.dirname(__file__)\n     if not wkfold:\n         wkfold = os.getcwd()\n         print(\"Current folder is:\", wkfold)\n     os.chdir(wkfold)\n     # will create work files here\n     pic.init(wkfold)\n     # loads the model - change the name here...\n     pic.cmdfile(\"model.dat\")\n     # select small pipe (diameter below 155)\n     # using iterator and D getter, by id\n     def pipefilter(diameter):\n         return 0 < diameter < 155\n     pipes = [p for p in pic.Links() if pipefilter(pic.linkattr(p, \"D\"))]\n     # using iterator and D getter, by index (less concise but slightly faster)\n     pipes = [\n         pic.getid(pic.LINK, k)\n         for k in range(1, pic.nbobjects(pic.LINK) + 1)\n         if pipefilter(pic.nlinkattr(k, \"D\"))\n     ]\n     # Most Piccoloic, using (french) command language selection\n     pic.setlang(\"French\")\n     # Selectid has been introduced in 2.3.0; it is equivalent to Selected(..., False)\n     pipes = list(pic.Selectid(\"TUYAU (D < 155) FIN\"))\n     # minimal setter functions for links, nodes, tanks attributes\n     pid = pipes[len(pipes) // 2]\n     diam = pic.linkattr(pid, \"D\")\n     pic.setlinkattr(pid, \"D\", diam * 2)\n     # language-independant commands: MODIF MULT D 2 ARC {pid} FIN\n     KWEND = pic.getkeyword(pic.DICT.END)\n     pic.gencmdw(pic.M.MOD, pic.M.MOD.MULT, pic.M.NONE, \"D 2\")\n     pic.gencmd(pic.M.LNK, pic.M.LNK.NONE, pic.M.NONE, pid + \" \" + KWEND, 1)\n     # Use command language to set / modify / delete objects\n     pic.execute(\"MODIF\", f\"DETR ARC {pid} FIN\")\n     pic.execute(\"MODIF\", \"FUSION NOEU (AA = 1) FIN\", \"FUSION NOEU (AA = 1) FIN\")\n     # or change parameters\n     pic.execute(\"SIMUL\", \"CRITX 0.05\", \"MXITER 75\")\n     # get demand profile TS\n     nb = pic.tsdemandlen(\"DEFAUT\", \"HAUT\")\n     print(\"Profile length for area HAUT:\", nb)\n     res = pic.tsdemand(\"DEFAUT\", \"HAUT\")\n     # Unlike epanet, first run simulation then browse/ query results\n     pic.full_solveH(silent=True, retry=True)\n     print(\"Simulation done.\")\n     pic.browseH(3600 * 8.5)\n     fig = plt.figure(figsize=(16 - 1, 9 - 1))\n     # plot 3D elevation and hydraulic head\n     ax = fig.add_subplot(projection=\"3d\")\n     for a in pic.Links():\n         x, y, z, v, nb = pic.linkXYZV(a, \"CH\")\n         if nb > 0:\n             ax.plot(x, y, z, \"r-\")\n             ax.plot(x, y, v, \"b-\")\n     plt.title(\"Plan de charge a t= 08:30\")\n     plt.show()\n     # print min/max pressure over the EPS\n     attr = \"P\"\n     minpax_p = list(pic.getMinMax(pic.NODE, attr))\n     for nid, vmin, vmax, vmoy in minpax_p[:10]:\n         print(nid, attr + \"min:\", vmin, attr + \"max:\", vmax)\n     print(\"\\t...\")\n     for nid, vmin, vmax, vmoy in minpax_p[-10:]:\n         print(nid, attr + \"min:\", vmin, attr + \"max:\", vmax)\n     # get current volume simulation (internal variable steps) and measurement TS\n     for tid in pic.Tanks():\n         t1, v1, nb1 = pic.tsval(pic.TANK, tid, \"VC\")\n         t2, v2, nb2 = pic.msval(pic.TANK, tid, \"VC\")\n     # get current volume simulation results at measurement sampling\n     for tid in pic.Tanks():\n         t3, v3, nb3 = pic.tsvalbymts(pic.TANK, tid, \"VC\")\n     # export as Epanet .inp\n     pic.exportEpanet(\"model.inp\")\n     pic.execute(\"XXMEM ARC : D\")\n     pic.savemodel(\"model_xx.dat\", extra_data=[(\"ARC (D > 149) FIN\", \"XX\")])\n     # WQ source data optional argument is a specific node - not used here\n     print(\"\\nWQ source data (input forcing and TS at nodes):\")\n     for n, cd, attr, t, c, nb in pic.WQSources():\n         print(n, cd, attr, nb, t, c)\n     print(\"Done.\")\n     # use reset() for switching model, close() to terminate\n     pic.close()\n\n\n\n",
    "bugtrack_url": null,
    "license": "commercial",
    "summary": "Python interface to Piccolo/Ganessa_SIM and Picalor simulation kernel",
    "version": "2.4.0",
    "project_urls": null,
    "split_keywords": [
        "piccolo",
        "picalor",
        "ganessa"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "802187d58e8bd0c8e399ed4fc056be3db2c3c509ca75b4e1f8775eedfe16a10c",
                "md5": "8acf8efc0e8ce45182fc08547ce82068",
                "sha256": "223bad3306852cbaea730abecb63d8a9cf2796a75707925fd11f0c3ad35ca728"
            },
            "downloads": -1,
            "filename": "ganessa-2.4.0-cp310-cp310-win32.whl",
            "has_sig": false,
            "md5_digest": "8acf8efc0e8ce45182fc08547ce82068",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.5, <4",
            "size": 3653446,
            "upload_time": "2024-01-16T07:54:23",
            "upload_time_iso_8601": "2024-01-16T07:54:23.150742Z",
            "url": "https://files.pythonhosted.org/packages/80/21/87d58e8bd0c8e399ed4fc056be3db2c3c509ca75b4e1f8775eedfe16a10c/ganessa-2.4.0-cp310-cp310-win32.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e7e66567e3310ea9d2a5bfccb6ecec62bc1e5a43f84fb50d45ee0708f6d815f5",
                "md5": "f8cc8b050c04eaa1c7beaf1da5e723ca",
                "sha256": "026cc89016907b83c1d8836beae392029a26a37809ab5dd8e645519ff739f47a"
            },
            "downloads": -1,
            "filename": "ganessa-2.4.0-cp310-cp310-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "f8cc8b050c04eaa1c7beaf1da5e723ca",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.5, <4",
            "size": 1380028,
            "upload_time": "2024-01-16T07:54:27",
            "upload_time_iso_8601": "2024-01-16T07:54:27.010789Z",
            "url": "https://files.pythonhosted.org/packages/e7/e6/6567e3310ea9d2a5bfccb6ecec62bc1e5a43f84fb50d45ee0708f6d815f5/ganessa-2.4.0-cp310-cp310-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2315bca481b1ef6fc306979011eae52cf1ac150ccd0d23efbf58fd28869c88f2",
                "md5": "eeb3e831a60bd14266182125c7c6951b",
                "sha256": "d900d2f7638102e8c34eddc28076677283aca22650f475f17debfe00de5b98fd"
            },
            "downloads": -1,
            "filename": "ganessa-2.4.0-cp311-cp311-win32.whl",
            "has_sig": false,
            "md5_digest": "eeb3e831a60bd14266182125c7c6951b",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": ">=3.5, <4",
            "size": 3600321,
            "upload_time": "2024-01-16T07:54:31",
            "upload_time_iso_8601": "2024-01-16T07:54:31.797411Z",
            "url": "https://files.pythonhosted.org/packages/23/15/bca481b1ef6fc306979011eae52cf1ac150ccd0d23efbf58fd28869c88f2/ganessa-2.4.0-cp311-cp311-win32.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "152bb8fff4139084d7db99b00cc047815d162964fb11860df0a6d08d7ce9dd8c",
                "md5": "b59e58e394218f207c5ebcf5b3b47250",
                "sha256": "c72b35e718687b6ef4ee875013556dfc6fd770df21846021ced33610960fbabc"
            },
            "downloads": -1,
            "filename": "ganessa-2.4.0-cp311-cp311-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "b59e58e394218f207c5ebcf5b3b47250",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": ">=3.5, <4",
            "size": 1390379,
            "upload_time": "2024-01-16T07:54:34",
            "upload_time_iso_8601": "2024-01-16T07:54:34.876192Z",
            "url": "https://files.pythonhosted.org/packages/15/2b/b8fff4139084d7db99b00cc047815d162964fb11860df0a6d08d7ce9dd8c/ganessa-2.4.0-cp311-cp311-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3d6c0709150942445022b39cc9036123507198633394777c79be466f8dfb4705",
                "md5": "f0553d504acf85f2179f193e6481e4ef",
                "sha256": "6c277cfcaa343d095b21f255b2c2016999a641f75588a49ea3b6171e382a3aeb"
            },
            "downloads": -1,
            "filename": "ganessa-2.4.0-cp312-cp312-win32.whl",
            "has_sig": false,
            "md5_digest": "f0553d504acf85f2179f193e6481e4ef",
            "packagetype": "bdist_wheel",
            "python_version": "cp312",
            "requires_python": ">=3.5, <4",
            "size": 2195413,
            "upload_time": "2024-01-16T07:54:38",
            "upload_time_iso_8601": "2024-01-16T07:54:38.337118Z",
            "url": "https://files.pythonhosted.org/packages/3d/6c/0709150942445022b39cc9036123507198633394777c79be466f8dfb4705/ganessa-2.4.0-cp312-cp312-win32.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "91912b3bcfd88fd99d65ab4224f2cc7c1ceeb0d75091ded1fbb662c60b91b62a",
                "md5": "03a96991cef7a69f0982f53563ef24ac",
                "sha256": "90dbe77f50352c73b668778685f1f10f34e834904c4a8046f335d5d0521bc510"
            },
            "downloads": -1,
            "filename": "ganessa-2.4.0-cp312-cp312-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "03a96991cef7a69f0982f53563ef24ac",
            "packagetype": "bdist_wheel",
            "python_version": "cp312",
            "requires_python": ">=3.5, <4",
            "size": 1426546,
            "upload_time": "2024-01-16T07:54:41",
            "upload_time_iso_8601": "2024-01-16T07:54:41.825132Z",
            "url": "https://files.pythonhosted.org/packages/91/91/2b3bcfd88fd99d65ab4224f2cc7c1ceeb0d75091ded1fbb662c60b91b62a/ganessa-2.4.0-cp312-cp312-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5fef220aef47ca1a87f97798786da7b8c412dc1abc132555b705f6c606e1d6aa",
                "md5": "add8f42d22c3f1a30b5d6ed6d0405ea1",
                "sha256": "fce12108b4f017c855951c29321109e07669c0611b37f789121ab6da4397cadb"
            },
            "downloads": -1,
            "filename": "ganessa-2.4.0-cp38-cp38-win32.whl",
            "has_sig": false,
            "md5_digest": "add8f42d22c3f1a30b5d6ed6d0405ea1",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": ">=3.5, <4",
            "size": 4169056,
            "upload_time": "2024-01-16T07:54:46",
            "upload_time_iso_8601": "2024-01-16T07:54:46.215571Z",
            "url": "https://files.pythonhosted.org/packages/5f/ef/220aef47ca1a87f97798786da7b8c412dc1abc132555b705f6c606e1d6aa/ganessa-2.4.0-cp38-cp38-win32.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cc6d62e97137f3353e29999db91d45c941cad5b879ef40bf436b59d56f356fd5",
                "md5": "9669adfc917b8eb15e71cb9058ae21a1",
                "sha256": "f5b1e5a573413a740e853e4c28f06af3c5f40ba7f7b30d03c85305926d8a7788"
            },
            "downloads": -1,
            "filename": "ganessa-2.4.0-cp38-cp38-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "9669adfc917b8eb15e71cb9058ae21a1",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": ">=3.5, <4",
            "size": 1431174,
            "upload_time": "2024-01-16T07:54:49",
            "upload_time_iso_8601": "2024-01-16T07:54:49.872525Z",
            "url": "https://files.pythonhosted.org/packages/cc/6d/62e97137f3353e29999db91d45c941cad5b879ef40bf436b59d56f356fd5/ganessa-2.4.0-cp38-cp38-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4c8c6ebc0d50f41af10e5d0431a463b51cf71d8260dc3edd6daf6347b22716c5",
                "md5": "2177b1181bcbbed2f49f47cb26d0d939",
                "sha256": "536cdb3f04394de94c76f84c30b90ccd81115c33015469c93b8df20d7bb195e7"
            },
            "downloads": -1,
            "filename": "ganessa-2.4.0-cp39-cp39-win32.whl",
            "has_sig": false,
            "md5_digest": "2177b1181bcbbed2f49f47cb26d0d939",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": ">=3.5, <4",
            "size": 3651257,
            "upload_time": "2024-01-16T07:54:54",
            "upload_time_iso_8601": "2024-01-16T07:54:54.716263Z",
            "url": "https://files.pythonhosted.org/packages/4c/8c/6ebc0d50f41af10e5d0431a463b51cf71d8260dc3edd6daf6347b22716c5/ganessa-2.4.0-cp39-cp39-win32.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0f75de77374a8a6af0eb692407dd694257a4b3ee4f18a9829496d7a24cc3af3b",
                "md5": "bda00677547e57858d78253fb4dd1622",
                "sha256": "a8072f7fbb6b2ffd8c9a9085fa997d325da341d34172738449320b46d856bc41"
            },
            "downloads": -1,
            "filename": "ganessa-2.4.0-cp39-cp39-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "bda00677547e57858d78253fb4dd1622",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": ">=3.5, <4",
            "size": 1433465,
            "upload_time": "2024-01-16T07:54:57",
            "upload_time_iso_8601": "2024-01-16T07:54:57.754398Z",
            "url": "https://files.pythonhosted.org/packages/0f/75/de77374a8a6af0eb692407dd694257a4b3ee4f18a9829496d7a24cc3af3b/ganessa-2.4.0-cp39-cp39-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-16 07:54:23",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "ganessa"
}
        
Elapsed time: 0.16717s