mirror of
https://github.com/not-kennethreitz/convore.json.git
synced 2026-06-21 15:40:58 +00:00
1 line
39 KiB
JSON
1 line
39 KiB
JSON
[{"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308582304.899564, "message": "ooh, bummer!", "group_id": 9959, "id": 1439100}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308585114.1700799, "message": "subdir*", "group_id": 9959, "id": 1439646}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308582019.199378, "message": "Hi how is it going", "group_id": 9959, "id": 1439043}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308583633.858573, "message": "It can also accept a list, use_backend([\"opencv\", \"opencl\"]) for backend priority, that specifies the sequence of fallback. Else it will fallback to numpy by default.", "group_id": 9959, "id": 1439321}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308583239.3220291, "message": "a string variable corresponding to the backend name. Stefan wanted it so that you can explore what backends are available.", "group_id": 9959, "id": 1439230}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308582865.085583, "message": "yes", "group_id": 9959, "id": 1439161}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308582308.0835669, "message": "set your dpi to like 40 or something", "group_id": 9959, "id": 1439101}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308582308.2724371, "message": "where is the source tree?", "group_id": 9959, "id": 1439102}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308582489.5408211, "message": "when we are happy with the backend, stefan can merge to master", "group_id": 9959, "id": 1439121}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308583299.7022991, "message": "yes", "group_id": 9959, "id": 1439241}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308582093.2200999, "message": "not too bad, yourself?", "group_id": 9959, "id": 1439060}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308582116.4514511, "message": "Tough few weeks :)", "group_id": 9959, "id": 1439065}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308583430.3610311, "message": "Haha it is all the same to me :) We can remove it and add a better version", "group_id": 9959, "id": 1439272}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308581967.855747, "message": "Whaddup!?", "group_id": 9959, "id": 1439039}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308582134.8002291, "message": "busy with school i take it?", "group_id": 9959, "id": 1439070}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308582206.759053, "message": "Yeah, and specs stolen among other things...squinting as I type ;)", "group_id": 9959, "id": 1439082}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308582260.3889239, "message": "Ok so we've hopefully stabilised our backend system to a certain degree", "group_id": 9959, "id": 1439090}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308582761.0171261, "message": "(was under the impression I did push it)", "group_id": 9959, "id": 1439148}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308583193.1155579, "message": "# create references for each backend in backends namespace\n backends_mod = sys.modules[\"scikits.image.backends\"]\n for backend_name in backends:\n setattr(backends_mod, backend_name, backend_name)", "group_id": 9959, "id": 1439216}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308583522.7105761, "message": "I think a lot of your dictionary management in the BackendManager class could benefit from collections.defaultdict", "group_id": 9959, "id": 1439297}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308583579.226315, "message": "also, when you iterate over a dictionary, the keys are returned by default, so:", "group_id": 9959, "id": 1439303}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308583591.0094309, "message": "is equivalent to :", "group_id": 9959, "id": 1439309}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308583594.945184, "message": "for key in some_dict: ...", "group_id": 9959, "id": 1439310}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308583646.266088, "message": "that perfoms a linear search over the list", "group_id": 9959, "id": 1439331}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308583976.423835, "message": "Python's logging isn't that bad, it's just a bit different from typical Python code.", "group_id": 9959, "id": 1439411}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308582349.590364, "message": "Hmm stil in a branch on my computer, hang on", "group_id": 9959, "id": 1439105}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308582474.7068501, "message": "then the workflow will be: update your branch -> send pull request", "group_id": 9959, "id": 1439120}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308583407.6732149, "message": "I think Stefan lost his mind a bit on that one :)", "group_id": 9959, "id": 1439268}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308583600.3284061, "message": "only the latter will be faster", "group_id": 9959, "id": 1439312}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308583633.01964, "message": "if function.__name__ in self.backend_listing[module_name][backend].keys():", "group_id": 9959, "id": 1439319}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308583656.6636021, "message": "if some_name in some_dict: ...", "group_id": 9959, "id": 1439335}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308584434.6517911, "message": "And that explicitness may give us more flexibility", "group_id": 9959, "id": 1439526}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308584491.440026, "message": "is the module name mangling intended to be:", "group_id": 9959, "id": 1439538}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308584802.646291, "message": "that's ok too, but numpy shouldn't really be treated differently", "group_id": 9959, "id": 1439592}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308584824.0011289, "message": "it should be in it's own backend dir as well, even though we use it as the default", "group_id": 9959, "id": 1439597}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308584975.844816, "message": "scikits/image/filter/backends/opencl/*files.py", "group_id": 9959, "id": 1439630}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308585495.313684, "message": "as the contract here is that, if you have a module variable in your backend module with the same name as function in the default implementation, it had better be an implementation of that function :)", "group_id": 9959, "id": 1439718}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308582443.7362001, "message": "fork the main repo, create a 'backends' branch", "group_id": 9959, "id": 1439114}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308582759.989141, "message": "https://github.com/holtzhau/scikits.image/tree/backman", "group_id": 9959, "id": 1439146}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308582874.7822499, "message": "k gimme a couple minutes to look it over", "group_id": 9959, "id": 1439162}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308583269.1738479, "message": "and that's the only thing its used for?", "group_id": 9959, "id": 1439238}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308583586.2805641, "message": "for key in some_dict.keys(): ...", "group_id": 9959, "id": 1439306}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308583657.8178101, "message": "instead", "group_id": 9959, "id": 1439336}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308584585.104641, "message": "I'm ok with the name mangling, but I think it should be consistent", "group_id": 9959, "id": 1439554}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308584591.9327359, "message": "rather than having a backend/ sub-dir", "group_id": 9959, "id": 1439555}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308584616.7363689, "message": "colorconv_numpy.py, colorconv_opencv.py, ... etct", "group_id": 9959, "id": 1439560}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308582383.584717, "message": "Sorry my lack of git skill shows. I guess I should merge it with master and then push?", "group_id": 9959, "id": 1439107}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308582458.817955, "message": "then send a pull request to stefan to pull in your `backend` branch", "group_id": 9959, "id": 1439116}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308582795.2518079, "message": "so I did spend some effort trying to avoid ini files", "group_id": 9959, "id": 1439152}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308583402.113025, "message": "Yup", "group_id": 9959, "id": 1439267}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308585390.749058, "message": "Yes", "group_id": 9959, "id": 1439701}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308582755.43661, "message": "right", "group_id": 9959, "id": 1439140}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308582761.5501561, "message": "Ok so there may be some stuff that I need to convince you about", "group_id": 9959, "id": 1439149}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308582762.0581429, "message": "We were really aiming for just dumping files in a module's associated backend directory and let that be that", "group_id": 9959, "id": 1439150}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308582854.151403, "message": "https://github.com/holtzhau/scikits.image/blob/backman/scikits/image/backend/backend.py", "group_id": 9959, "id": 1439159}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308583192.3220589, "message": "what's the purpose of this?", "group_id": 9959, "id": 1439215}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308583354.2383499, "message": "then you could just do from scikits.image import registered_backends", "group_id": 9959, "id": 1439249}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308582760.5106299, "message": "here is my branch I've been working on", "group_id": 9959, "id": 1439147}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308582824.0764201, "message": "The documentation for each function are updated according to what backends are available at the start", "group_id": 9959, "id": 1439155}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308582853.431946, "message": "is this the file I should be looking at?", "group_id": 9959, "id": 1439158}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308583205.1721499, "message": "Right so that registers in", "group_id": 9959, "id": 1439219}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308583228.862371, "message": "which is just an empty subpackage?", "group_id": 9959, "id": 1439227}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308583333.103662, "message": "hmm, maybe that would be better served as a list or a set in scikits.image.__init__.py", "group_id": 9959, "id": 1439244}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308583425.81655, "message": "Leave it for now, I'll talk with him about it :)", "group_id": 9959, "id": 1439271}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308583638.6330199, "message": "if function.__name__ in self.backend_listing[module_name][backend].keys():", "group_id": 9959, "id": 1439328}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308583665.3938529, "message": "that will be O(1) instead of O(n)", "group_id": 9959, "id": 1439337}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308583830.3755801, "message": "take a look at the warnings module", "group_id": 9959, "id": 1439377}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308584265.3081379, "message": "yeah, lazy importing is best", "group_id": 9959, "id": 1439487}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308584370.238745, "message": "it's additional overhead though...", "group_id": 9959, "id": 1439507}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308584413.7088101, "message": "The benefit of ini files though is that they are explicit.", "group_id": 9959, "id": 1439521}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308582855.064348, "message": "at the moment: Backends supported:\n -------------------\n opencv\n See also: scikits.image.filter.backend.edges_opencv.sobel\n opencl\n See also: scikits.image.filter.backend.edges_opencl.sobel", "group_id": 9959, "id": 1439160}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308582929.774719, "message": "But backend equivalents of module files may only implement a few of the functions, and it is hard to know without importing. We can't import everything at the start though.", "group_id": 9959, "id": 1439166}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308582958.1541159, "message": "So I've tried an alternative to configuration ini file, by using the ast module to parse the backend file and extract all function definitions", "group_id": 9959, "id": 1439173}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308583471.2163661, "message": "I am trying to hone my sense of all things pythonic. So yes please tell me if you detect something that could be done better.", "group_id": 9959, "id": 1439284}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308583665.7393949, "message": "Ah of course", "group_id": 9959, "id": 1439338}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308583745.043987, "message": "backing(function) returns all the backends supported by a function", "group_id": 9959, "id": 1439355}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308583834.1868601, "message": "Yes, I'm about to improve on that.", "group_id": 9959, "id": 1439378}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308583211.536912, "message": "scikits.image.backends", "group_id": 9959, "id": 1439222}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308583261.4796231, "message": "scikits.image.backends.opencv etc", "group_id": 9959, "id": 1439236}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308583631.5970459, "message": "So we have use_backends() function that you select the current backend.", "group_id": 9959, "id": 1439316}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308583634.592998, "message": "defaultdict: noted", "group_id": 9959, "id": 1439326}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308583635.0641201, "message": "right", "group_id": 9959, "id": 1439327}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308583362.894891, "message": "Yeah Stefan wants tab completion exploration :)", "group_id": 9959, "id": 1439250}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308583997.451431, "message": "Yeah it is powerful, but I always need to look up documentation to use it :)", "group_id": 9959, "id": 1439417}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308583315.3152621, "message": "Perhaps a bit too similar to scikits.image.backend?", "group_id": 9959, "id": 1439242}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308584046.8222041, "message": "You ok with the ast scanning?", "group_id": 9959, "id": 1439433}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308584862.9596519, "message": "yeah that sounds something I'd like the best", "group_id": 9959, "id": 1439605}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308585021.483552, "message": "ok so subdirs in backend instead of mangling?", "group_id": 9959, "id": 1439635}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308583389.489816, "message": "why? you're only tab completing a variable whose value is a string of the same name", "group_id": 9959, "id": 1439259}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308583632.042963, "message": "also:", "group_id": 9959, "id": 1439317}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308583648.042058, "message": "use:", "group_id": 9959, "id": 1439332}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308583822.9931929, "message": "print(\"Warning: Falling back to %s implementation\" % fallback)", "group_id": 9959, "id": 1439375}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308583999.0336161, "message": "but yes, we should create our own logger which uses Python's logging system (since it's thread safe)", "group_id": 9959, "id": 1439418}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308584218.35182, "message": "ah...", "group_id": 9959, "id": 1439471}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308584631.96275, "message": "and the agreement is that the numpy module provides the default implementation", "group_id": 9959, "id": 1439562}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308584753.8972631, "message": "scikits/image/filter/numpy/*, scikits/image/filter/opencv/*", "group_id": 9959, "id": 1439586}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308584844.479949, "message": "we should not consider it a \"numpy\" backend", "group_id": 9959, "id": 1439599}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308584920.029361, "message": "or you may not use numpy at all for a default, if it can be done efficiently with python", "group_id": 9959, "id": 1439612}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308584926.206393, "message": "I would suggest this then:", "group_id": 9959, "id": 1439616}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308585073.9097879, "message": "because you may, for example, want other sub-dirs as well", "group_id": 9959, "id": 1439643}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308585109.7341859, "message": "so your manager will look for the backends/ sub-dir, and each sub-dir inside there will define a backend with name of the subdire", "group_id": 9959, "id": 1439645}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308585181.4711881, "message": "then you can just walk the modules in the sub-dir and match function names with the default implementation", "group_id": 9959, "id": 1439658}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308584032.85274, "message": "we work on performance tweaks later on", "group_id": 9959, "id": 1439429}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308584133.194387, "message": "class SomeWeirdBackend(object):\n def some_func(self, *args, **kwargs):\n return stuff\n\nsingleton = SomeWeirdBackend()\n\nsome_func = singleton.some_func", "group_id": 9959, "id": 1439451}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308584178.4130881, "message": "I think it should be possible to have the decorator register the function with the manager", "group_id": 9959, "id": 1439461}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308584188.95281, "message": "that should remove the need for scanning", "group_id": 9959, "id": 1439462}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308584525.3175399, "message": "(I suppose I should keep that in another branch?)", "group_id": 9959, "id": 1439546}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308583889.082037, "message": "since python's logging system is such a jungle", "group_id": 9959, "id": 1439394}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308585305.045511, "message": "If we only end with two kinds, use_backend and use_plugin would suffice", "group_id": 9959, "id": 1439687}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308583675.5614791, "message": "the point of a dict indeed hehe", "group_id": 9959, "id": 1439339}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308583785.121134, "message": "hm I guess all the functions supported by a backend could also be helpful", "group_id": 9959, "id": 1439368}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308584011.2152669, "message": "ok, finished looking over the code", "group_id": 9959, "id": 1439423}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308584069.6161649, "message": "ah, yes... about that", "group_id": 9959, "id": 1439440}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308584081.80112, "message": "this is the problem I see with that:", "group_id": 9959, "id": 1439443}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308584327.907896, "message": "yeah, I suppose you could do:", "group_id": 9959, "id": 1439498}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308584599.3106179, "message": "you could keep everything in the parent dir and have:", "group_id": 9959, "id": 1439556}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308584667.2737391, "message": "then you can rename the backends/ sub-module to backend_management/ or somehting, and it will be more reflective of it's purpose", "group_id": 9959, "id": 1439572}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308585023.3944161, "message": "the name of the modules in the backends should correspond to the module names in the default parent dir", "group_id": 9959, "id": 1439636}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308585025.6978681, "message": "yeah", "group_id": 9959, "id": 1439637}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308583869.5963991, "message": "Stefan suggests we write a logging wrapper for the scikits.image library", "group_id": 9959, "id": 1439390}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308584023.1420729, "message": "I think it's theoretically (sp?) sound", "group_id": 9959, "id": 1439426}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308584040.772908, "message": "we can* work on...", "group_id": 9959, "id": 1439431}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308584163.162142, "message": "eah", "group_id": 9959, "id": 1439458}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308584248.3892601, "message": "I had a system that imported everything at the start, but when the backends become numerous that may not be wanted.", "group_id": 9959, "id": 1439484}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308584312.917083, "message": "The fallback would be ini files :( But yeah we could also just make it part of the backend spec that functions are expected", "group_id": 9959, "id": 1439496}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308584352.836664, "message": "@add_backend\ndef some_funcwrapper(*args, **kwargs):\n return singleton.some_func(*args, **kwargs)", "group_id": 9959, "id": 1439502}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308584208.1605461, "message": "The issue is though, the backends need to register themselves without importing", "group_id": 9959, "id": 1439467}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308585224.911478, "message": "I looked at your plugin system and realised that we do almost the same :) Though our attempt here is hopefully simpler.", "group_id": 9959, "id": 1439666}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308585251.018687, "message": "Visualisation and processing", "group_id": 9959, "id": 1439672}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308584430.489754, "message": "Depends on how often one would encounter singletons in this context.", "group_id": 9959, "id": 1439524}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308584457.7222321, "message": "completely different question:", "group_id": 9959, "id": 1439531}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308584780.5875161, "message": "I think we tried to keep the backend stuff a little bit at arms length with the sub dir", "group_id": 9959, "id": 1439588}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308584899.2411849, "message": "because we may switch from numpy for default in the future ;)", "group_id": 9959, "id": 1439608}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308585043.4214361, "message": "the reason for the additional backends/ dir is to make source tree traversal easier", "group_id": 9959, "id": 1439639}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308585175.758363, "message": "Right. Perhaps a case of don't fix it if it is not broken, but we can also merge the io plugin system with the current one", "group_id": 9959, "id": 1439656}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308584772.3251851, "message": "then we dont need to mangle the module name", "group_id": 9959, "id": 1439587}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308584864.6318679, "message": "I'm really just arguing from a stylistic perspective", "group_id": 9959, "id": 1439606}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308584475.7334371, "message": "https://github.com/holtzhau/scikits.image/tree/backman/scikits/image/color/backend", "group_id": 9959, "id": 1439533}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308584519.6251609, "message": "$operations$_$backend$.py ?", "group_id": 9959, "id": 1439542}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308584959.871012, "message": "scikits/image/filter/backends/opencv/*files.py", "group_id": 9959, "id": 1439625}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308584556.294621, "message": "operations being the module in the parent directory that is being supported", "group_id": 9959, "id": 1439549}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308584717.7078209, "message": "I would be happy with:", "group_id": 9959, "id": 1439582}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308584832.183327, "message": "OR", "group_id": 9959, "id": 1439598}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308585278.9511759, "message": "ok, I think I have a better way for you to extract the names from a module", "group_id": 9959, "id": 1439677}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308584929.3935809, "message": "exactly", "group_id": 9959, "id": 1439617}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308585238.707886, "message": "It would require two tiers of backends though", "group_id": 9959, "id": 1439669}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308584713.1343989, "message": "alternatively", "group_id": 9959, "id": 1439581}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308584798.1769149, "message": "else if the backends become numerous, it could get noisy. Also helps with scanning :)", "group_id": 9959, "id": 1439591}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308584811.722918, "message": "The default implementation?", "group_id": 9959, "id": 1439594}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308584937.702992, "message": "scikits/image/filter/*default.py", "group_id": 9959, "id": 1439619}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308585200.5298431, "message": "yeah, I would like to see the two methods of registration unified", "group_id": 9959, "id": 1439662}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308585357.5686309, "message": "so what you can do is this:", "group_id": 9959, "id": 1439697}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308584850.9965439, "message": "and use \"default\" to refer to it instead", "group_id": 9959, "id": 1439601}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308585073.8603101, "message": "I was trying to keep the structure as flat as possible (Avoiding near empty dirs) But yeah we can do it this way.", "group_id": 9959, "id": 1439642}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308585576.8362811, "message": "Ah great I'll look into it. I did encounter compile, but heard that it may disappear in python 3.0", "group_id": 9959, "id": 1439736}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308585352.0113349, "message": "since the default backend will always be imported, and it defines the reference implementation, the task is really to see if there is a module level variable in the backend which corresponds to an @add_backend decorated function in the default implementation", "group_id": 9959, "id": 1439696}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308585394.6221039, "message": "code_obj = compile(open(backend_filename).read(), '', mode='exec')\nmodule_var_names = code_obj.co_names", "group_id": 9959, "id": 1439702}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308586081.6152489, "message": "Anyway, got to run. If you have any more suggestions leave it here or at my blog post.", "group_id": 9959, "id": 1439802}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308585685.8122311, "message": "Can't find a reference to that claim right now...but will make sure.", "group_id": 9959, "id": 1439753}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308585493.425005, "message": "that won't perform any imports", "group_id": 9959, "id": 1439716}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308586088.420862, "message": "Thanks for joining!", "group_id": 9959, "id": 1439803}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308585809.5499151, "message": "Ok but it sounds that the general structure of the backend system is okay? I'll wrap it up now, and then we can move on to algorithms/video processing.", "group_id": 9959, "id": 1439767}, {"user_id": 33559, "stars": [], "topic_id": 39870, "date_created": 1308645617.933161, "message": "So that you would do something like:\n\nfrom scikits.image.backends import numpy, opencl\nsobel(..., backend=numpy)\nsobel(..., backend=opencl)\n\nIf we agree that the backends will be referred to by name only, then a list would do the job.\n\nAs for the logging, Python's module is fine--it just needs a wrapper to make it easily usable:\n\nfrom scikits.image import log\nlog.log('This is some info', error_level=1)\n\nwith some pre-agreed error-levels.", "group_id": 9959, "id": 1446599}, {"user_id": 33559, "stars": [], "topic_id": 39870, "date_created": 1308645448.9049001, "message": "The rationale behind allowing tab-completion in the back-ends, was that we considered that back-ends may be objects other than strings", "group_id": 9959, "id": 1446588}, {"user_id": 33559, "stars": [], "topic_id": 39870, "date_created": 1308645446.536556, "message": "Hey, guys... glad to see I was classified as insane in my absence :)", "group_id": 9959, "id": 1446586}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308715263.317796, "message": "A backend object opens some interesting possibilities", "group_id": 9959, "id": 1454707}, {"user_id": 34630, "stars": [], "topic_id": 39870, "date_created": 1308818826.3933229, "message": "Scrolling back, I see that this was discussed a bit. I would come down on the side of more explicit (and hopefully more flexible).", "group_id": 9959, "id": 1464561}, {"user_id": 34630, "stars": [], "topic_id": 39870, "date_created": 1308818441.2398851, "message": "The CellProfiler project has experienced some pain with modules that expect source to be easily available.", "group_id": 9959, "id": 1464520}, {"user_id": 34630, "stars": [], "topic_id": 39870, "date_created": 1308818636.371192, "message": "So I think I'd like to ask the meta-question: why not just have the backend system try to import every backend (which does require something in __init__), and raise a NotImplemented exception?", "group_id": 9959, "id": 1464531}, {"user_id": 34630, "stars": [], "topic_id": 39870, "date_created": 1308818358.793761, "message": "Does the compile(...) method of finding objects work in cases where the source may not be available in the usual way? I'm thinking in particular of py2exe/py2app outputs.", "group_id": 9959, "id": 1464516}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308864458.8015749, "message": "we are trying to avoid importing as much as possible until its actually needed. For example, people shouldn't need PyOpenCL installed to use the scikit. But the opencl backend will most definitely be importing it. This means we can't just import that backend unless it's actually being used.", "group_id": 9959, "id": 1471387}, {"user_id": 34630, "stars": [], "topic_id": 39870, "date_created": 1308901008.065465, "message": "yes.", "group_id": 9959, "id": 1475042}, {"user_id": 34630, "stars": [], "topic_id": 39870, "date_created": 1308899750.27563, "message": "Why not do so in a try...except?", "group_id": 9959, "id": 1474968}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308900424.060513, "message": "(e.g. __doc__)", "group_id": 9959, "id": 1474997}, {"user_id": 34630, "stars": [], "topic_id": 39870, "date_created": 1308899893.4010141, "message": "And how should we optimize for simplicity of writing new backends vs. packaging binaries that use the scikit?", "group_id": 9959, "id": 1474977}, {"user_id": 34630, "stars": [], "topic_id": 39870, "date_created": 1308899917.5944669, "message": "(I'm unsure which is the more common event.)", "group_id": 9959, "id": 1474978}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308899962.1869371, "message": "I think it also has to do with needlessly importing supporting libraries.", "group_id": 9959, "id": 1474979}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308899977.5650909, "message": "But you have a point with binary packaging, would work less well in that setup.", "group_id": 9959, "id": 1474981}, {"user_id": 34630, "stars": [], "topic_id": 39870, "date_created": 1308899986.1442831, "message": "that is a valid concern.", "group_id": 9959, "id": 1474982}, {"user_id": 34630, "stars": [], "topic_id": 39870, "date_created": 1308900359.667402, "message": "Well, if we're using the use_backend()/keyword approach, maybe the use_backend() function can do the import.", "group_id": 9959, "id": 1474994}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308900385.3063769, "message": "At the moment it does, but we need to know what functions are supported for documentation purposes.", "group_id": 9959, "id": 1474995}, {"user_id": 34630, "stars": [], "topic_id": 39870, "date_created": 1308901093.1277609, "message": "Nevermind my comment about use_backend() doing the import. I had misremembered how it would behave.", "group_id": 9959, "id": 1475047}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308900659.614465, "message": "(that is scanning backend directory for ini files)", "group_id": 9959, "id": 1475010}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308900537.713213, "message": "An alternative would be to specify with use of ini files, but we would have similar problems in binary packaged distributions in that case?", "group_id": 9959, "id": 1475002}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308901509.907912, "message": "Yeah. I'm sure the binary packaging issue can be sorted in time.", "group_id": 9959, "id": 1475083}, {"user_id": 34630, "stars": [], "topic_id": 39870, "date_created": 1308901232.123822, "message": "I think it's possible to give hints to the packaging system what files should be included (such as .py or .ini). I wonder if it's worth the tradeoff, though.", "group_id": 9959, "id": 1475057}, {"user_id": 34630, "stars": [], "topic_id": 39870, "date_created": 1308901283.4088941, "message": "And actually, I'm beginning to think the right answer is to stop worrying about the backend management, for now, and concentrate on implementing different functions in the backends.", "group_id": 9959, "id": 1475065}, {"user_id": 34630, "stars": [], "topic_id": 39870, "date_created": 1308901430.863483, "message": "A large number of backend implementations with a limited management system is much better than only a few implementations and a really good management system.", "group_id": 9959, "id": 1475075}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308925015.5125501, "message": "then you can import a package (which won't import any modules) and get all the info you need out of the __init__.py package variables", "group_id": 9959, "id": 1476622}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308924774.880579, "message": "people still try to package python binaries? why do people still use windows?", "group_id": 9959, "id": 1476588}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308924972.3543429, "message": "it would be a bit of extra work for the dev, but really only like two lines of code", "group_id": 9959, "id": 1476613}, {"user_id": 22813, "stars": [], "topic_id": 39870, "date_created": 1308924953.8983321, "message": "we could do something like place information in the __init__.py files of the package which declare which modules and functions are available.", "group_id": 9959, "id": 1476610}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308949369.54585, "message": "hmm i'm wondering how to test the various backends with nose tests. decorators don't seem to work well there", "group_id": 9959, "id": 1480223}, {"user_id": 33626, "stars": [], "topic_id": 39870, "date_created": 1308949370.1304941, "message": "@test_backends in front of a test to indicate all backends should be tested would be nice", "group_id": 9959, "id": 1480225}, {"user_id": 34630, "stars": [], "topic_id": 39870, "date_created": 1308994687.191256, "message": "We (CellProfiler project) package on Mac and Windows... our target users are biologists, and saying something like \"get python and built numpy and scipy\" (or even just to have them install all of them) is not an option.", "group_id": 9959, "id": 1483420}, {"user_id": 33559, "stars": [], "topic_id": 39870, "date_created": 1309058119.624074, "message": "Holtzhau: How about something like: from scikits.image import backends; for b in backends: yield my_func, ..., backend", "group_id": 9959, "id": 1486949}] |