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

Don't print full modules in doctest output #944

Closed
rofinn opened this issue Feb 6, 2019 · 3 comments
Closed

Don't print full modules in doctest output #944

rofinn opened this issue Feb 6, 2019 · 3 comments

Comments

@rofinn
Copy link
Contributor

rofinn commented Feb 6, 2019

The following output in the REPL:

24-element Array{AnchoredInterval{-1 hour,ZonedDateTime},1}:
 AnchoredInterval{-1 hour,ZonedDateTime}(2016-08-12T01:00:00-05:00, Inclusivity(false, true))
 AnchoredInterval{-1 hour,ZonedDateTime}(2016-08-12T02:00:00-05:00, Inclusivity(false, true))
 AnchoredInterval{-1 hour,ZonedDateTime}(2016-08-12T03:00:00-05:00, Inclusivity(false, true))
 AnchoredInterval{-1 hour,ZonedDateTime}(2016-08-12T04:00:00-05:00, Inclusivity(false, true))
 AnchoredInterval{-1 hour,ZonedDateTime}(2016-08-12T05:00:00-05:00, Inclusivity(false, true))
 AnchoredInterval{-1 hour,ZonedDateTime}(2016-08-12T06:00:00-05:00, Inclusivity(false, true))
 AnchoredInterval{-1 hour,ZonedDateTime}(2016-08-12T07:00:00-05:00, Inclusivity(false, true))
 AnchoredInterval{-1 hour,ZonedDateTime}(2016-08-12T08:00:00-05:00, Inclusivity(false, true))
 AnchoredInterval{-1 hour,ZonedDateTime}(2016-08-12T09:00:00-05:00, Inclusivity(false, true))
 AnchoredInterval{-1 hour,ZonedDateTime}(2016-08-12T10:00:00-05:00, Inclusivity(false, true))
 ⋮
 AnchoredInterval{-1 hour,ZonedDateTime}(2016-08-12T16:00:00-05:00, Inclusivity(false, true))
 AnchoredInterval{-1 hour,ZonedDateTime}(2016-08-12T17:00:00-05:00, Inclusivity(false, true))
 AnchoredInterval{-1 hour,ZonedDateTime}(2016-08-12T18:00:00-05:00, Inclusivity(false, true))
 AnchoredInterval{-1 hour,ZonedDateTime}(2016-08-12T19:00:00-05:00, Inclusivity(false, true))
 AnchoredInterval{-1 hour,ZonedDateTime}(2016-08-12T20:00:00-05:00, Inclusivity(false, true))
 AnchoredInterval{-1 hour,ZonedDateTime}(2016-08-12T21:00:00-05:00, Inclusivity(false, true))
 AnchoredInterval{-1 hour,ZonedDateTime}(2016-08-12T22:00:00-05:00, Inclusivity(false, true))
 AnchoredInterval{-1 hour,ZonedDateTime}(2016-08-12T23:00:00-05:00, Inclusivity(false, true))
 AnchoredInterval{-1 hour,ZonedDateTime}(2016-08-13T00:00:00-05:00, Inclusivity(false, true))

Shows up as:

24-element Array{AnchoredInterval{-1 hour,ZonedDateTime},1}:
 Intervals.AnchoredInterval{-1 hour,TimeZones.ZonedDateTime}(2016-08-12T01:00:00-05:00, Inclusivity(false, true))
 Intervals.AnchoredInterval{-1 hour,TimeZones.ZonedDateTime}(2016-08-12T02:00:00-05:00, Inclusivity(false, true))
 Intervals.AnchoredInterval{-1 hour,TimeZones.ZonedDateTime}(2016-08-12T03:00:00-05:00, Inclusivity(false, true))
 Intervals.AnchoredInterval{-1 hour,TimeZones.ZonedDateTime}(2016-08-12T04:00:00-05:00, Inclusivity(false, true))
 Intervals.AnchoredInterval{-1 hour,TimeZones.ZonedDateTime}(2016-08-12T05:00:00-05:00, Inclusivity(false, true))
 Intervals.AnchoredInterval{-1 hour,TimeZones.ZonedDateTime}(2016-08-12T06:00:00-05:00, Inclusivity(false, true))
 Intervals.AnchoredInterval{-1 hour,TimeZones.ZonedDateTime}(2016-08-12T07:00:00-05:00, Inclusivity(false, true))
 Intervals.AnchoredInterval{-1 hour,TimeZones.ZonedDateTime}(2016-08-12T08:00:00-05:00, Inclusivity(false, true))
 Intervals.AnchoredInterval{-1 hour,TimeZones.ZonedDateTime}(2016-08-12T09:00:00-05:00, Inclusivity(false, true))
 Intervals.AnchoredInterval{-1 hour,TimeZones.ZonedDateTime}(2016-08-12T10:00:00-05:00, Inclusivity(false, true))
  ⋮
 Intervals.AnchoredInterval{-1 hour,TimeZones.ZonedDateTime}(2016-08-12T16:00:00-05:00, Inclusivity(false, true))
 Intervals.AnchoredInterval{-1 hour,TimeZones.ZonedDateTime}(2016-08-12T17:00:00-05:00, Inclusivity(false, true))
 Intervals.AnchoredInterval{-1 hour,TimeZones.ZonedDateTime}(2016-08-12T18:00:00-05:00, Inclusivity(false, true))
 Intervals.AnchoredInterval{-1 hour,TimeZones.ZonedDateTime}(2016-08-12T19:00:00-05:00, Inclusivity(false, true))
 Intervals.AnchoredInterval{-1 hour,TimeZones.ZonedDateTime}(2016-08-12T20:00:00-05:00, Inclusivity(false, true))
 Intervals.AnchoredInterval{-1 hour,TimeZones.ZonedDateTime}(2016-08-12T21:00:00-05:00, Inclusivity(false, true))
 Intervals.AnchoredInterval{-1 hour,TimeZones.ZonedDateTime}(2016-08-12T22:00:00-05:00, Inclusivity(false, true))
 Intervals.AnchoredInterval{-1 hour,TimeZones.ZonedDateTime}(2016-08-12T23:00:00-05:00, Inclusivity(false, true))
 Intervals.AnchoredInterval{-1 hour,TimeZones.ZonedDateTime}(2016-08-13T00:00:00-05:00, Inclusivity(false, true))

Our current solution is to load Intervals.jl and TimeZones.jl into the Main module for printing to work nicely.

```@meta
DocTestSetup = quote
    using Intervals, TimeZones, Dates

    # This is a hack to have nice printing that doesn't include module names.
    @eval Main begin
        using Intervals, TimeZones
    end
end

It'd be nice if doctests did this automatically, but maybe this is more of an issue with how base julia special cases the Main module?

@fredrikekre
Copy link
Member

Yea, I think this should be solved from Julia's side, e.g. JuliaLang/julia#29466. Would it not work to using in make.jl instead of that hack? That should also load them in Main.

@bicycle1885
Copy link
Contributor

Fredrik's advice works well in my case. Thank you very much.

@odow
Copy link
Collaborator

odow commented Oct 31, 2023

I'm doing a triage of open documenter issues and closing issues that are stale. If I've made a mistake, please re-open

Closing as stale and because this seems resolved.

@odow odow closed this as completed Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants