Skip to content
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

Feature request: .plt support for L #10

Open
deven367 opened this issue Feb 11, 2023 · 3 comments
Open

Feature request: .plt support for L #10

deven367 opened this issue Feb 11, 2023 · 3 comments

Comments

@deven367
Copy link

deven367 commented Feb 11, 2023

hey @xl0, thanks for building this amazing library. I was just playing with this library today and I realized that I prefer having my numpy arrays many times as L objects in memory (mostly because I get to use additional functions from fastcore with them). It would be amazing if .plt worked for the L object as well.

Right now, if I wish to use it the L object, I just wrap it as np.asarray and use it. I looked at the source code and it seems doable to include L as well. Any thoughts on this?

@xl0
Copy link
Owner

xl0 commented Feb 12, 2023

Heya. Thank you! 💕

Just to make sure we are on the same page, could you give me a piece of code where you use numpy in this way?

@deven367
Copy link
Author

@xl0 here is the source code, in this example, my L object is just a 1d array

for key in keys:
    ssm = std.get(key)
    far = np.asarray(farthest_sim(ssm)) # farthest_sim returns a L()
    with working_directory(new_path):
        lo(far).plt.fig.savefig(f'{key}.png', dpi=300)

@xl0
Copy link
Owner

xl0 commented Feb 12, 2023

Thank you. I'll have a look next week, should be pretty easy to implement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants