-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accessing the cartesian routine #98
Comments
@oyamad Thanks. It needed to be added to the |
Oops, closed it by accident. Open again. |
@jstac Many thanks! One comment and one issue:
|
@oyamad Thanks for feedback. Please feel free to add a comment to the developers wiki on that point you mention: https://github.com/QuantEcon/QuantEcon.py/wiki @albop Any thoughts on point 2? |
Just out of curiosity, I commented on this issue by mail but it doesn't show online. Did you receive it ? |
Here is the content of the mail I sent. Please disregard it if you have already read it. On point 2, @oyamad is perfectly right. It would be indeed be better if the cartesian set had the same type as the inputs. If the output is stored as a single array, there will still be the restriction that all list of nodes are assumed to be of the same type (i.e. no product of a set of integer by a set of floats), but that is probably a weaker restriction. One thing that we have to make sure of is, that the routine, responsible for performing the product is correctly compiled for the various types. I will make a pull request for that, just let me a few days. About the initial question of whether cartesian should be accessible from the top-level namespace, I am not a big fan of the change since it seems that the function cartesian() will shadow the module cartesian. [currently qe.cartesian refers to the module]. Ultimately, the problem is the fact that the module contains a function with the same name, so maybe one of them would need to change. I am not sure about what the canonical naming scheme would be. Something that I like to see in the same module would be a julia-like repeat function that basically merges numpy.tile, and numpy.repeat. So I guess the module is the one that should be renamed. How would you call it ? |
@albop I didn't receive this comment separate from your reposting. I'm not sure why. I checked my email at github and it's fine. How about gridtools or grid_tools? (Underscores aren't conventional in Python module names but they have already crept in to the library and I find they improve readability.) |
Seems like this is resolved. Can anyone confirm and close? |
The cartesian package has to be renamed to |
I'd vote for |
Fine by me. |
Hi,
I wanted to use
cartesian
, but found it a bit tricky to access it.Does not work:
It raises
AttributeError: 'module' object has no attribute 'cartesian'
.(The same goes for
qe.cartesian.cartesian([[0, 1], [0, 1], [0, 1]])
.)Works:
Is this as intended?
It is not mentioned in the documentation.
The text was updated successfully, but these errors were encountered: