Skip to content

Remove initial newline from show()#129

Open
thirtysixbananas wants to merge 1 commit into
s-broda:masterfrom
thirtysixbananas:removenewline
Open

Remove initial newline from show()#129
thirtysixbananas wants to merge 1 commit into
s-broda:masterfrom
thirtysixbananas:removenewline

Conversation

@thirtysixbananas
Copy link
Copy Markdown

On Base.show() the print shouldn't start with a \n

For example, in the following code the last line does not display properly in vscode:

import ARCHModels
rets = rand(Float64, (100,5))
volspec = ARCHModels.CCC(Statistics.cor(rets), Float64[], [ARCHModels.GARCH{1, 1}([1., .9, .05]) for _ in 1:2])
model = ARCHModels.MultivariateARCHModel(volspec, rets)

On Base.show() the print shouldn't start with a \n

For example, in the following code the last line does not display properly in vscode:

```julia
import ARCHModels
rets = rand(Float64, (100,5))
volspec = ARCHModels.CCC(Statistics.cor(rets), Float64[], [ARCHModels.GARCH{1, 1}([1., .9, .05]) for _ in 1:2])
model = ARCHModels.MultivariateARCHModel(volspec, rets)
```
@s-broda
Copy link
Copy Markdown
Owner

s-broda commented Apr 10, 2026

Can you make sure the tests and doctests pass?

@thirtysixbananas
Copy link
Copy Markdown
Author

Sorry, this was a drive-by commit and I never looked at it again until now.

Looking at it now, I'm confused by this [1]. What is happening here? Why is it testing that the show starts with a certain string, which is different depending on the version? Do you want to test that the show changed with version, or that the type changed with version?

[1]

@test startswith(str, "TGARCH{1,1,1} specification.\n\n─────────────────────────────────\n ω γ₁ β₁ α₁\n─────────────────────────────────\nParameters: 1.0 0.05 0.9 0.01\n─────────────────────────────────")

@s-broda
Copy link
Copy Markdown
Owner

s-broda commented Apr 29, 2026

That's because of a change in Julia itself to the way parameterized types are displayed.

@thirtysixbananas
Copy link
Copy Markdown
Author

Ok, but why does it need to be tested?

@s-broda
Copy link
Copy Markdown
Owner

s-broda commented Apr 30, 2026

Well, I guess I aim for maximum test coverage :)

@thirtysixbananas
Copy link
Copy Markdown
Author

Haha. Are you open to be convinced that this is a bad idea? :-)

@s-broda
Copy link
Copy Markdown
Owner

s-broda commented Apr 30, 2026

Probably not ;)

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

Successfully merging this pull request may close these issues.

2 participants