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

visualize_ascii on unit test case is broken #92

Open
rkurchin opened this issue Jan 16, 2024 · 2 comments
Open

visualize_ascii on unit test case is broken #92

rkurchin opened this issue Jan 16, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@rkurchin
Copy link
Collaborator

(potentially related to #83)

If I just copy/paste this code from test/interface.jl into the REPL:

box = [[1, 0, 0], [0, 1, 0], [0, 0, 1]]u"m"
bcs = [Periodic(), Periodic(), DirichletZero()]
positions = [[0.25, 0.25, 0.25], [0.75, 0.75, 0.75]]u"m"
elements = [:C, :C]
atoms = [Atom(elements[i], positions[i]) for i in 1:2]

flexible = FlexibleSystem(atoms, box, bcs)

I get:

Error showing value of type FlexibleSystem{3, Atom{3, Quantity{Float64, 𝐋, Unitful.FreeUnits{(m,), 𝐋, nothing}}, Quantity{Float64, 𝐋 𝐓⁻¹, Unitful.FreeUnits{(a₀, s⁻¹), 𝐋 𝐓⁻¹, nothing}}, Quantity{Float64, 𝐌, Unitful.FreeUnits{(u,), 𝐌, nothing}}}, Quantity{Int64, 𝐋, Unitful.FreeUnits{(m,), 𝐋, nothing}}}:
ERROR: ArgumentError: invalid Array dimensions

I haven't tried to track down exactly what is causing this, but it doesn't seem to affect any functionality (or cause any tests to fail, since tests only test show and not display, which is what is called in the REPL if you just put the variable name), I'm wondering if we should just dispatch display to show by default. Is there any foreseeable issue with that approach?

@mfherbst mfherbst added the bug Something isn't working label Jan 24, 2024
@mfherbst
Copy link
Member

I'm wondering if we should just dispatch display to show by default. Is there any foreseeable issue with that approach?

Don't know the details, but I recall that the two functions are not doing the same thing. Also I believe this is just a bug in visualize_ascii, where the canvas to plot is chosen too large or with negative dimensions. That would be my guess.

@mfherbst mfherbst changed the title display is broken visualize_ascii on unit test case is broken Jan 24, 2024
@cortner
Copy link
Member

cortner commented May 19, 2024

I thought I ran into this during debugging as well. But now the tests seem to be running fine again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants