Giter Club home page Giter Club logo

matchingmarkets.py's People

Contributors

cclauss avatar nealmcb avatar thesourcerer8 avatar vhranger 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

matchingmarkets.py's Issues

Undefined names: to_match_names_m, to_match_names_f

If verbose is True when this code is run then NameError will be raised.

% flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics

./matchingmarkets/algorithms/DA.py:103:52: F821 undefined name 'to_match_names_m'
                  iter_num, "\n\tTo Match males:", to_match_names_m,
                                                   ^
./matchingmarkets/algorithms/DA.py:105:19: F821 undefined name 'to_match_names_f'
                  to_match_names_f)
                  ^
2     F821 undefined name 'to_match_names_m'
2

ImportError: Cannot load backend 'Qt5Agg' which requires the 'qt5' interactive framework, as 'headless' is currently running

Attempting to import MatchingMarkets in Google Codelab environment running Python 3.6 however getting the following error:

import matchingmarkets as mm

ImportError Traceback (most recent call last)
in ()
----> 1 import matchingmarkets as mm
2 #import matplotlib
3 #matplotlib.use('TKAgg')

4 frames
/usr/local/lib/python3.6/dist-packages/matplotlib/pyplot.py in switch_backend(newbackend)
234 "Cannot load backend {!r} which requires the {!r} interactive "
235 "framework, as {!r} is currently running".format(
--> 236 newbackend, required_framework, current_framework))
237
238 rcParams['backend'] = rcParamsDefault['backend'] = newbackend

ImportError: Cannot load backend 'Qt5Agg' which requires the 'qt5' interactive framework, as 'headless' is currently running


After doing some research on the error, it seems others have had similar error with matplotlib, though it is not clear if the suggested workaround would help in this case.

Any insights would be greatly appreciated.. or alternatively if you happen to have a clean install with MatchingMarkets already working somewhere in an online notebook/environment , please advise where it can be accessed. Thanks.

Explain installation of package, dependencies

Some more hints in the README on how to pull in the dependencies and run this would be helpful.

So far this worked for me to avoid import errors:

pip install scipy networkx PyQt5

Then, since I don't see a pyproject.toml or setup.py, I just tried to run python from the root directory of the project, as cloned via git.

But I'm guessing that I'm getting different versions than you are, since I get these errors:

Python 3.8.0 (default, Oct 28 2019, 16:14:01)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import matchingmarkets as mm
>>> import numpy.random as rng
>>> newsim = mm.simulation(time_per_run=100, max_agents=5000, arrival_rate=15,typeGenerator=rng.randint, 
   compatFct=mm.stochastic_neighborSameType,crit_input=3, numTypes=5)
>>> newsim.graph(plot_time=0.8)
Attribute Qt::AA_EnableHighDpiScaling must be set before QCoreApplication is created.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/srv/s/games/MatchingMarkets.py/matchingmarkets/simulations.py", line 254, in graph
    newMarket.update(metaAlgorithm=self.metaAlgorithm,
  File "/srv/s/games/MatchingMarkets.py/matchingmarkets/market.py", line 393, in update
    nx.draw_networkx_edges(self.Graph, self.graph_pos,
TypeError: draw_networkx_edges() got an unexpected keyword argument 'font_size'
>>>

It looks like I have networkx version 2.5.

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.