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

visualization of the half-edges is not working #13

Open
PinkGenji opened this issue Aug 28, 2024 · 7 comments
Open

visualization of the half-edges is not working #13

PinkGenji opened this issue Aug 28, 2024 · 7 comments

Comments

@PinkGenji
Copy link

Hi,

I am trying to use the "show half-edge" function from the visualization demo, but running the code from the demo gives me an error:

"TypeError: init() takes 2 positional arguments but 3 were given".

The error seems to be originated from the line about "ax.add_collection", contained in the file: "plt-draw.py", under function "draw_edge".

I have no idea on how to fix it, would you please give me some directions perhaps?

@glyg
Copy link
Member

glyg commented Aug 29, 2024

Hi @PinkGenji, sorry I don't have much bandwith for this these day..
Can you copy / paste the whole error message here?
Thank you

@PinkGenji
Copy link
Author

Hi @glyg
Please see the following of the whole error message.

Traceback (most recent call last):

Cell In[3], line 7
fig, ax = sheet_view(sheet,['x','y'], **draw_specs)

File ~.conda\envs'myenv'\lib\site-packages\tyssue\draw_init_.py:34 in sheet_view
return sheet_view_2d(sheet, coords[:2], ax, **draw_specs_kw)

File ~.conda\envs'myenv'\lib\site-packages\tyssue\draw\plt_draw.py:164 in sheet_view
ax = draw_edge(sheet, coords, ax, **edge_spec)

File ~.conda\envs'myenv'\lib\site-packages\tyssue\draw\plt_draw.py:285 in draw_edge
ax.add_collection(PatchCollection(patches, False, **collections_specs))

TypeError: init() takes 2 positional arguments but 3 were given

Cheers.

@glyg
Copy link
Member

glyg commented Aug 29, 2024

Oh so it seems that in the latest versions of matplotplib the second argument (with value False) in the code above, is a keyword only argument. Also is default value is False.

Did you install tyssue from source or through conda?

The fix is easy, just remove False at line 285 in plt_draw.py. I can patch it here but do not have time to do a true release right now (and in a forceable future).

Do you feel capable of installing from source?

@PinkGenji
Copy link
Author

Hi @glyg
Thank you very much for your help, the problem is fixed!
I installed Tyssue via conda as I am on a Windows machine, do you recommend I install it from source (if I only have access to Windows and Mac but not Linux)?

@glyg
Copy link
Member

glyg commented Sep 5, 2024

Good to hear the problem is fixed
The source is more up to date than the conda package (couldn't debug the build last time I tried)

Windows should not be a problem if you use the conda environment file provided.
If you want to try, you can open a Pull Request with the fix above, I'll merge it :)

@PinkGenji
Copy link
Author

Hi @glyg

After checking the source code on DamCB/Tyssue, I believe the bug has been fixed (hence no need to pull request?). The problem arise because I got Tyssue via conda-forge, and the latest version in conda-forge is still version 0.9

@glyg
Copy link
Member

glyg commented Sep 9, 2024

Ah well all good then :)

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