#16331: Game Theory: Build capacity to solve matching games in to Sage.
-------------------------------------+-------------------------------------
Reporter: vinceknight | Owner:
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-6.4
Component: game theory | Resolution:
Keywords: Game Theory, | Merged in:
Matching Games, | Reviewers: Karl-Dieter Crisman,
Authors: Vince Knight, | Travis Scrimshaw
James Campbell | Work issues:
Report Upstream: N/A | Commit:
Branch: | 821808ee3cbd503414058b6d289da3ffdf31e153
u/vinceknight/game_theory__build_capacity_to_solve_matching_games_in_to_sage_|
Stopgaps:
Dependencies: |
-------------------------------------+-------------------------------------
Comment (by vinceknight):
Replying to [comment:118 tscrim]:
> I wouldn't mark them as `# random`, then the only thing that gets tested
is that there is no error returned. If the doctest ordering can't be
sorted uniformly, then I'd test specific properties. Although I thought we
did something with our doctests involving dicts so that the output was
sorted...?
I was suggesting the `# random` not from the testing point of view but
from a point of view of accessibility of new users viewing the docs and
knowing what the output 'should almost certainly look like'. So I'm
suggesting putting one of these at the top of the front matter saying
something like 'Output of the solve method is a dictionary as shown (the
order of this might differ on your machine)::'
I think there is something in the dicts that ensures that output is
sorted. This seemed evident when I put in the relevant methods to be able
to sort instances of `Players` but it looks like this one very particular
example is enough to throw it off where my machine 1 sorted numerical
variables before strings and my machine 2 the other way around.
My last commit 821898e I think is the best way to go with this. If the
ordered output of a dictionary cannot be guaranteed, the output of a given
key of that dictionary certainly can. So I suggest going through each
element (manually) and viewing the output.
So I've gone with:
{{{
sage: D = g.solve()
sage: D['Mercutio']
sage: 'Rosaline'
sage: D['Romeo']
'Juliet'
sage: D[3]
-3
}}}
I think that to ensure tests pass on all machines etc this only needs to
be done for some of the dictionaries (where strings and numerical
variables are mixed) as the dictionaries do seem to be sorted as far as I
can see (please correct me if I'm talking nonsense). I don't think it's a
big deal to do it for all of the tests though.
I think this has the advantage of being readable and accessible to those
reading the docs who don't really know about lambda functions and other
subtleties...
I've only done it for the one test (the one causing issues) but throughout
the day (am chairing a Careers fair today) I might have some time to jump
on the ol' laptop.
--
Ticket URL: <http://trac.sagemath.org/ticket/16331#comment:120>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.