Giter Site home page Giter Site logo

Comments (2)

benmaier avatar benmaier commented on June 12, 2024

copying of JS-source files does not work. copying the data and config, however, does work.

also, there's this error:

KeyError                                  Traceback (most recent call last)
<ipython-input-1-8b5a672fdf69> in <module>
      5 
      6 G = nx.barabasi_albert_graph(1000,1)
----> 7 result, config = wulf.visualize(G)

c:\users\maierb\documents\python scripts\netwulf\netwulf-master\netwulf\interactive.py in visualize(network, port, verbose, config)
    282     # actually re-draw the figure and display it
    283     env = os.environ
--> 284     program = os.path.basename(env['_'])
    285     if 'jupyter' in program:
    286         fig, ax = wulf.draw_netwulf(posted_network_properties)

~\AppData\Local\Continuum\anaconda3\lib\os.py in __getitem__(self, key)
    676         except KeyError:
    677             # raise KeyError with the original key value
--> 678             raise KeyError(key) from None
    679         return self.decodevalue(value)
    680 

KeyError: '_'```

I guess, this is fixable by asking for key `'JPY_PARENT_PID'` in `os.environ`

from netwulf.

benmaier avatar benmaier commented on June 12, 2024
        # an empty POST means the server should be stopped
        if content_length == 0:
            try:
                body = self.rfile.read(content_length)
                self.send_response(200)
                self.end_headers()
                response = BytesIO()
                response.write(b'Closing now.')
                self.wfile.write(response.getvalue())
            except:
                self.server.end_requested = True
        else:
    # see whether or not the whole thing was started from a jupyter notebook and if yes,
    # actually re-draw the figure and display it
    env = os.environ
    try:
        is_jupyter = 'jupyter' in os.path.basename(env['_'])
    except:
        is_jupyter = 'JPY_PARENT_PID' in env 
    if is_jupyter:        
        fig, ax = wulf.draw_netwulf(posted_network_properties)

from netwulf.

Related Issues (20)

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.