That being said we do not want to register all computable maps on
startup. So we have to find the good balance between interesting maps
as "the number of descents in a permutation" and uninteresting maps as
"the polynomial map 57*n^2 - 18*n +3 from {-12, 1, 42, 2243} to the
integers".
That being said we do not want to register all computable maps on
startup. So we have to find the good balance between interesting maps
as "the number of descents in a permutation" and uninteresting maps as
"the polynomial map 57*n^2 - 18*n +3 from {-12, 1, 42, 2243} to the
integers".
Dead right ! Is there any reason why gathering this semantic information requires this decorator to wrap the function in a combinatorial map ? Can't the information be gathered wherever we need it *without* modifying the actual function ? You could do whatever you need with a decorator that, when applied to a function f with some flags, stores a copy of this function f and works with the flags while returning the original function f, can't you ?This would make it less intrustive, and actually not intrusive at all !
> The way I see this, *because* of the FindStat use case, the
> combinatorial_map decorator has been introduced and many Sage developers
> have been devoted time into adding semantic information into sage methods.
> Of course, we could remove this all together, but this would be a great loss
> for Sage as this semantic information is useful for users. And Here, I speak
> as a combinatorist person working with these objects every day.
>
> So, our concern should be: how to make this information easily available to
> users and how could we store this without impacting efficiency of the
> program.Dead right ! Is there any reason why gathering this semantic information requires this decorator to wrap the function in a combinatorial map ? Can't the information be gathered wherever we need it *without* modifying the actual function ? You could do whatever you need with a decorator that, when applied to a function f with some flags, stores a copy of this function f and works with the flags while returning the original function f, can't you ?This would make it less intrustive, and actually not intrusive at all !
--
You received this message because you are subscribed to the Google Groups "sage-combinat-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-combinat-d...@googlegroups.com.
To post to this group, send email to sage-comb...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/d/optout.
On 2014-05-27, Viviane Pons <vivia...@gmail.com> wrote:
> The way it works: the decorator replaces the tagged methods by instances of
> combinatorial map class, the functions only checks which methods are indeed
> instances of this class.
And, if I understand correctly, it is this kind of things that makes
Nathann ask for removal of the decorator.
What you *want* to do is create a database that handles requests of the
type "what combinatorial maps are provided by a class C?", or perhaps even
better "what combinatorial maps are provided by a sub-category S of
Sets().Finite()?". This could very well be a (SQLAlchemy?) database that is
stored somewhere, perhaps even in a remote location.
But what you *do* is to encode this database via the *type* of methods.
The information is not put into an external database, but the
information is stored *implicitly* by changing Sage code.
I agree with Nathann: This is intrusive! And when your decorator
replaces methods by "instances of some class" then certainly the
overhead of calling these methods will increase. Applying your decorator
to a frequently (recursively?) used method may result in a slow-down, as
it seems.
Even when trying to take your perspective, I still don't understand why
you might want the decorator to work in that way.
Certainly a proper database (relying on a dedicated database engine) is
faster and easier to search and thus more useful for you than an ad-hoc
function that ultimately relies on listing attributes and determining
their types.
So, what is the rationale for *not* using a database for your database of
combinatorial maps?
> It is partly the information you need even so I'm not sure it's a good way
> to have it.
I see no reason how this could be a good way to have it.
> And also, this function is hidden somewhere and not accessible
> from the object or the parent itself.
"Hidden somewhere" is bad for a user interface.
> About Nathan's suggestion to have a flag, I don't know if it's such a good
> idea. The idea is to provide this semantic information to any user of Sage
> not machines.
It seems to me that you are argueing *against* the current decorator.
Calling a function that is hidden somewhere and relies on introspection
(listing attributes, type check) is for machines. A user of Sage should
have a database with a proper interface.
> The way I see this, *because* of the FindStat use case, the
> combinatorial_map decorator has been introduced and many Sage developers
> have been devoted time into adding semantic information into sage methods.
> Of course, we could remove this all together, but this would be a great
> loss for Sage as this semantic information is useful for users. And Here, I
> speak as a combinatorist person working with these objects every day.
>
> So, our concern should be: how to make this information easily available to
> users and how could we store this without impacting efficiency of the
> program.
Do not store information by a decorator that changes code. Migrate it to
a proper database, that may be stored in SAGE_SHARE. The decorator
should write information into the database (or perhaps even pull
information from it?) and, when done, simply return the unaltered
method. In that way, it would not be intrusive, and the database would
provide a not-so-hidden single point of entry.
Best regards,
Simon
--
You received this message because you are subscribed to the Google Groups "sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
To post to this group, send email to sage-...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
> For anyone involved in findstat, there are several layers of complexity.
> This is my assessment from outside the findstat collaboration:
> - they also deal with Mathematica code
> - they also deal with user-generated information that is not code
You just provided two arguments for having an external database :)
> - they also develop some of the code and would thus 1) prefer to maintain
> one rather than two separate objects (code and database)
That's no valid argument. Currently, they simply put a decorator in front of a
method. In future, they'll simply put a decorator in front of a method.
The important difference is that now the decorator is replacing a proper
method by an instance of some class, which is an intrusive way to encode
information that is supposed to be retrieved by a function that is hidden
somewhere. But in future the decorator will be writing to some database with
a standard database engine, without replacing the method by something else.
> 2) like to easily
> and flexibly be able to develop the code as they intend to use it (i.e.
> equipped with everything, cf. monkey patching)
Again, this seems unrelated to the question of what the decorator should
do.
> - some of the information they want is added/could easily be added by
> others in sage code
Again, adding information is now and shall in future be possible by putting
a decorator in front of methods.
> - just like the LMFDB, the database term is a misnomer. They want their
> thing to be data and code.
So, why don't they focus on their data and code? Why do they spend their time
with an ad-hoc implementation of a mock-database in an intrusive way? Do
not re-invent the wheel, and try to use the right tool for a job!
Let me try to re-formulate it:
- There should be a database, locally stored in SAGE_SHARE, but perhaps
even able to talk with some remote database. This database would also
be able to deal with external information, from Mathematica or other
sources.
- The @combinatorial_map decorator will be one (the easiest?) way to
register stuff in the database.
- The user should in future have additional possibilities to register stuff and
do queries, namely by a proper database interface.
--
--
--> It will not be possible (say within the next two years, except the
unlikely event that I will a lottery without participating, and then
spend some money to hire a professional programmer) to only query the
statistics data, and do the computations within your own Sage.
--
You received this message because you are subscribed to the Google Groups "sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
To post to this group, send email to sage-...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
--
You received this message because you are subscribed to the Google Groups "sage-combinat-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-combinat-d...@googlegroups.com.
To post to this group, send email to sage-comb...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel.
> But how am I then convincing
> someone knowing that information to add that information there?
Ask him/her to put @combinatorial_map in front of the method in
question. In other words, there should be no need to change the interface
for those who contribute combinatorial maps. What should change is how this
contribution is processed. It should not be the case that, as a result,
the overhead of calling a method increases!
What I (an Nathann?) am trying to convince y'all: @combinatorial_map
should not wrap a method into some class instance that serves as a proxy
to the method and holds additional information purely locally. Instead,
@combinatorial_map should communicate with a (local) database before
returning the method *unwrapped*. And then, there should additionally
be tools to use the local database together with a global one.
> What I
> like about a local system (preferably accompanying the code of the
> very method) is that it makes it easy for the person having
> information about a specific map to provide that information.
To give you a drastic picture: Imagine you work for a company and want
to keep track who is your customer. You suggest to attach a little tag
to each customer, stating that (s)he is "happy customer of FooBar ltd.". It
will then be very easy to test if a given person is your customer: Just
look for the tag. And when you want to have a list of your customers in
a given town: Just do an exhaustive search in that twon and check each
person's tag!
But I somehow feel that having a database keeping track of your
customers would be better. And I do believe that tagging a method as
"combinatorial map" locally is the same as tagging your customers
locally. So, the picture applies.
> Of course, that information must be organized to be searchable
> properly. But I don't see a problem there beside conventional namings.
Hang on. Do you suggest to implicitly create a database that relies on
naming schemes??
I think one can not deny: What y'all do with the @combinatorial_map *is*
in fact creating a database---at least implicitly---, whether you want
it or not. But explicitly is better than implicitly, and one should not
re-invent the wheel. So...
Best regards,
Simon
On 2014-05-28, Paul-Olivier Dehaye <paul-oliv...@math.uzh.ch> wrote:
> Christian's point is key. The absolute hardest problem to solve is where to
> anchor semantic information so that others can contribute to it easily,
> ...
> Right now, by lack of a better place, it is put in sage.
I think you miss the point of what Nathann and I try to say.
I think Nathann agrees that it is a reasonable idea to have a @combinatorial_map
decorator in front of a method (I do agree), provided that it gives useful
information to some people (this is the case now), and provided that it
does not have a negative impact for people who don't use this
information---and currently it *does* have a negative impact, because of
a slow-down in potentially time-critical methods.
Last attempt before leaving office:
- Currently we have a lose-lose situation: When people put
@combinatorial_map, then it has a negative impact to some other
people (the slow-down), and it is difficult to use the added information
for those who want to do proper queries.
- We should better have a win-win situation: When people put
@combinatorial_map, then it should not change the method (to not
slow-down stuff), and the added information should be accessible to
queries in a reasonable way.
Cheers,
Simon
--
You received this message because you are subscribed to the Google Groups "sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
To post to this group, send email to sage-...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
--
> Two comments:
> - Nathann is arguing that no empty methods/classes should be present.
Is he? Sorry, then this is a point where Nathann and I do not agree. I
find abstract methods useful. I thought that his main point was: Don't
be intrusive! Do not make code of some people slower just because other
people care about the mathematical properties of some methods. And from
my perspective, the discussion is (or should be) only about the
question: How to care about the mathematical properties without slowing
down other peoples code.
> - They are not building a database. They are putting tags in the code that
> allow them at runtime to build something that amounts to a database. It's
> not that different to the category framework in some way, which is encoding
> a lot of data via code constructions
There was in fact some discussion at #10963 about the question whether it is
a good idea that the new category-with-axiom framework encodes a fully-grown
would-be-database (by this, I mean something that amounts to a database) by
purely local data and naming conventions.
I'd say: If they are putting tags in the code then they *do* create a
(would-be-)database, whether they want it or not.
> I am not arguing that what findstat does with a decorator is the best. A
> flagged decorator that does nothing most of the time is better than what
> they do. But a full-on database is, as a short term solution, heading in
> the wrong direction.
Do I understand correctly: You would not like that the
@combinatorial_map decorator constructs a database at startup time? I
think that's a valid concern.
We could try to be clever and introduce an environment variable (or
commandline argument) such that @combinatorial_map creates a database
when this variable is set, and otherwise does nothing at all.
Hence, people who care about the implicit would-be-database encoded in
the flags could obtain them by explicit request, and all other people
would not be affected at all.
Would this be a short-term solution? Also from Nathann's perspective?
Cheers,
For me, it would makes sense on parents directly
{{{
sage: Permutations().known_maps_to(Partitions())
[...]
}}}
And in the methods known_maps_to and known_maps_from there should be
pointer on how to feed the database with more maps. But I would charge
the elements with that.
--
> Would it be possible to include the findstat functionality in sage?
It is possible to write the code, and desirable. As the Sage is open-source, you are also welcome to give it a try if you need the feature. Sage already queries the OEIS, though for FindStat you will probably have to design some kind of protocol to transfer the combinatorial objects with the website's owners. I am told that you can contact them at in...@findstat.org.
Nathann
Hi Martin,
On 2014-05-28, 'Martin R' via sage-combinat-devel <sage-comb...@googlegroups.com> wrote:
>> E.g., it should know domain and codomain, and it should know
>> what category it belongs to. I think it makes sense to let a morphism
>> know whether it is injective or surjective. However, additional
>> information that is certainly interesting to researchers (e.g.: "Was first
>> defined by John Doe in his seminal paper in Journal of Applied
>> Irrelevance") clearly should not be stored as an attribute of a morphism.
>>
>
> I do not see any reason why such information should not be stored somewhere
> within sage, possibly in form of a database. Could you please explain?
I clearly said: "... should not be stored as an attribute OF A
MORPHISM". I also clearly said "... is certainly interesting to
researchers", hence (which I said in other parts of the post) it would
certainly be worth-while to store somewhere in Sage. I just doubt that
storing it locally as an attribute of a morphism is a good idea.
Best regards,
Simon
E.g., it should know domain and codomain, and it should know
what category it belongs to. I think it makes sense to let a morphism
know whether it is injective or surjective. However, additional
information that is certainly interesting to researchers (e.g.: "Was first
defined by John Doe in his seminal paper in Journal of Applied
Irrelevance") clearly should not be stored as an attribute of a morphism.
> BUT: this would result in code in Sage that is not useful purely
> within Sage. And there are people, loud people, that say there should
> not be such code in Sage.
I can hear your frustration ... In similar situations, it helped me to
keep in mind that loud people are not always representative. Of course
the difficulty is to fetch the opinion from the others.
--
Nathann
--
You received this message because you are subscribed to the Google Groups "sage-combinat-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-combinat-d...@googlegroups.com.
To post to this group, send email to sage-comb...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel.
--
There is definitely frustration on both "sides". My offer for you to come and talk in Zurich is serious, it's easier to talk in person. We could even invite you to a seminar to talk about mathematics. Then we go chill out somewhere and we talk about sage.