Comments (16)
(matplotlib is another kettle of fish as there is no alternative)
Could use https://plot.ly/ instead
from axelrod.
There are many alternatives to matplotlib.
from axelrod.
My opinion is that it is good to choose solid dependencies and stick to them throughout the whole project. And I think NumPy is about as solid as they get.
from axelrod.
Matplotlib would be the standard thing I'd suggest to go for for a Python project (even with adding in the 1 liner that transforms plots in to plot.ly plots).
My opinion is that it is good to choose solid dependencies and stick to them throughout the whole project. And I think NumPy is about as solid as they get.
My only query with that is with the entry level to contributing (I know some colleagues who have never installed a packaged or used a cli and if they read that they needed to would just shrug and walk away). Given that we don't need to use Numpy (it's probably saving 4~10 lines of code) I wonder if we should.
It could be nice to decide this here (and as you say @langner: stick to it, perhaps write it in the README.md somewhere). I'm in no way adverse to using numpy if we think that's the way to go, I just want to make sure we do it for the right reasons.
from axelrod.
And I am in no way proselytizing NumPy, at least for this project. I just noticed that you had started to use it again in the "core" code, and so simplified some of the more bulky nested lists I encountered.
from axelrod.
And I am in now way proselytizing NumPy, at least for this project. I just noticed that you had started to use it again, and so simplified some of the more bulky nested lists I encountered.
Yup, I think that got past me in a PR to be honest.
What do you reckon though, do you agree with me that it's nicer to keep it plain Python if possible or do you think that's not worth worrying about? :)
from axelrod.
What do you reckon though, do you agree with me that it's nicer to keep it plain Python if possible or do you think that's not worth worrying about? :)
Well... no, I don't agree that it's nicer. You have a clear case where using numpy arrays is more natural than plain Python.
Besides, you already do use it, even if only in run_tournament.py
. If I give some thought to a "new user", that is the first file they will run/open/read. It will take them less time to download and install NumPy that to understand how to use your code independent of run_tournament.py
.
So, if I were you I would choose between using numpy everywhere or getting rid of it altogether.
from axelrod.
Well... no, I don't agree that it's nicer. You have a clear case where using numpy arrays is more natural than plain Python.
I think by nicer, I did not mean the code base (I certainly agree with you) but that it's nicer to have a philosophy of "you don't need anything else to make this run".
It will take them less time to download and install NumPy that to understand how to use your code independent of run_tournament.py.
I know some (fair few actually) for which that would not be true, but perhaps those are not the people who would be able to contribute anyhow (although I have had a student contribute with no knowledge of Python which was cool). If someone is getting this from github they probably can install Numpy...
So, if I were you I would choose between using numpy everywhere or getting rid of it altogether.
This is exactly what I'm trying to do. Just want to talk it over that's all :)
Ultimately (thinking aloud here) I keep coming back to the fact that Numpy is not doing much here at all. It's a minor convenience I would argue to use it. The numerics are not heavy and we just want to make writing to csv a bit less of a pain.
from axelrod.
So... what is the decision? :)
from axelrod.
Let me just see if @meatballs has anything to add and then I'll make a call. I think it's just important that we set out from now what the guidelines are (as you say) before it takes too long to actually go through and change it 😿
from axelrod.
Ok, have been watching some reality TV and mulling this over in my head (instead of figuring out who should be voted off for their mediocre singing) and I think I've made a decision. I'd like to keep this base Python:
- Remove Numpy
- Include an exception catcher for matplotlib (used to be in a script so wasn't a big deal but @meatballs is doing some cool stuff to get it in the library itself). So if someone tries to plot but doesn't have matplotlib they get a message saying 'woops no matplotlib... type pip bla bla bla' .
I don't think Numpy is currently doing enough to warrant losing the 'built in pure Python' tag.
@langner and @meatballs: you guys are pretty much the main contributors to this (and I'm so very grateful, this has been such great fun!) so if you think I'm being stupid (or a d**k) let me know. Otherwise I'll open two issues for the above two points to 'de-Numpify' everything (although the second point might be able to be incorporated in to Owen's upcoming PR).
from axelrod.
Having never used numpy or matplotlib before, they are the areas where I start to lose track of what's going on. Issue #88 is a good example.
The numpy documentation is good, so there's less of a problem there. It also made the code to pre-populate the scores with zeroes a lot more concise and easier to read. Not sure I care too much either way on this one.
I find the matplotlib documentation hard going, but once we have that within a properly tested class of its own, we shouldn't have to touch it too much (and I'll just avoid it)!!
So, to conclude, I'm happy with the suggestion above.
from axelrod.
Just realised (possibly slightly too late) that numpy is a dependency of matplotlib - it doesn't make a whole lot of sense to use one but not the other.
from axelrod.
Yes but matplotlib
is being caught be the exception, so I think it make sense to not have numpy
actually used specifically for anything: so someone could use this and code for it using just basic Python (they wouldn't be able to plot though).
from axelrod.
OK
from axelrod.
I have branched and started to write a document about contributing, I'll keep adding to it when I get a moment here and there but just let you guys know in case it's of interest - 3e89576
from axelrod.
Related Issues (20)
- Reorganisation ? of cheating strategies
- Add a citation.cff file HOT 6
- Links to contributing guide broken by docs restructure
- CI failing due to typing issues HOT 3
- Implement asymmetric games HOT 6
- Game classification HOT 4
- Implement abstract games more fully (5.0.0)
- Restructure strategies folder HOT 4
- Documentation for 5.0.0
- Simplify/move the `ResultSet` HOT 1
- Expressing in a formal logical language HOT 2
- You may have missed some details in your code HOT 1
- I couldn't find the strategy submitted by Mauk in the competition for 19th place HOT 2
- If I want to test the first tournament, what should I do based on your code? HOT 2
- Do you know the source code of the first tournament? HOT 2
- axelrod.plot.Plot may be incompatible with recent Pandas udpates HOT 2
- Change the TFT in the first tournament HOT 3
- High-noise Tournament for comparison HOT 1
- Supporting Python 3.12 HOT 1
- Deal with new numpy version
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from axelrod.