GithubHelp home page GithubHelp logo

process-intelligence-research / sfiles2 Goto Github PK

View Code? Open in Web Editor NEW
40.0 40.0 11.0 1.16 MB

Conversion between PFDs/P&IDs and SFILES 2.0 strings

License: MIT License

Python 21.87% Jupyter Notebook 78.13%

sfiles2's People

Contributors

arturschweidtmann avatar edwinhirtreiter avatar gavogel avatar lukasschbal avatar tonyzyl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

sfiles2's Issues

Visualization issue: dependency issue

Hi Devs,
Many thanks for your work on this. I have tried installing with python 3.9 in a new env and it shows the following error in the demo:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
[~\AppData\Local\Temp\ipykernel_4180\2667648479.py](https://file+.vscode-resource.vscode-cdn.net/c%3A/Users/User/Documents/MyProj/SFILES2/~/AppData/Local/Temp/ipykernel_4180/2667648479.py) in 
      3 flowsheet_1=Flowsheet()
      4 flowsheet_1.state=G
----> 5 flowsheet_1.visualize_flowsheet(table=False, pfd_path='plots/flowsheet1', plot_with_stream_labels=False)

[c:\Users\User\Documents\MyProj\SFILES2\Flowsheet_Class\flowsheet.py](file:///C:/Users/TonyZ/Documents/MyProj/SFILES2/Flowsheet_Class/flowsheet.py) in visualize_flowsheet(self, figure, plot_with_stream_labels, table, plot_as_pfd, pfd_block, decimals, pfd_path, chemicalspecies, add_positions)
    406         if plot_as_pfd:
    407             # Create a flowsheet.
--> 408             plot_flowsheet_pyflowsheet(self.state, block=pfd_block, imagepath=pfd_path, add_positions=add_positions)
    409             # No return, is directly saved as svg using the image-path.
    410 

[c:\Users\User\Documents\MyProj\SFILES2\Flowsheet_Class\utils_visualization.py](file:///C:/Users/TonyZ/Documents/MyProj/SFILES2/Flowsheet_Class/utils_visualization.py) in plot_flowsheet_pyflowsheet(graph, block, imagepath, pfd_id, pfd_name, pfd_description, add_positions)
    364     filename = imagepath + ".svg"
    365     ctx = SvgContext(filename)
--> 366     img = pfd.draw(ctx)
    367 
    368     if not os.path.exists('plots'):

[c:\Users\User\anaconda3\envs\sfiles\lib\site-packages\pyflowsheet\core\flowsheet.py](file:///C:/Users/TonyZ/anaconda3/envs/sfiles/lib/site-packages/pyflowsheet/core/flowsheet.py) in draw(self, ctx)
    174         for s in self.streams.values():
    175             ctx.startGroup(s.id)
--> 176             s.draw(ctx, grid, minx, miny)
...
---> 78             self.process_node(
     79                 graph, neighbor, node, end, open_list, open_value)
     80 

TypeError: process_node() takes from 5 to 6 positional arguments but 7 were given

I have found the error is due to the pyflowsheet package allows pathfinding >=1.0.1 while apparently the pathfinding has made some changes. Adding pathfinding==1.0.1 would fix this issue, I will create a pull request later on.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.