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

Failure creating JuMP DenseAxisArray #806

Closed
neelsmith opened this issue Dec 24, 2020 · 1 comment
Closed

Failure creating JuMP DenseAxisArray #806

neelsmith opened this issue Dec 24, 2020 · 1 comment
Labels
display & PlutoRunner & AbstractPlutoDingetjes.jl other packages Integration with other Julia packages

Comments

@neelsmith
Copy link

neelsmith commented Dec 24, 2020

Julia noob interested in JuMP for numeric optimization. I'm trying to translate into a Pluto notebook the example code in diet.jl here: https://github.com/jump-dev/JuMP.jl/blob/master/docs/src/examples/diet.jl

  • I can clone the JuMP repo and run the example test successfuly
  • I can copy the julia code from the test set and run a julia script successfully
  • I can copy the julia code into a jupyter notebook and run the notebook successfully

but if I copy the julia code into a Pluto notebook, I get the following error.

with foods defined as

foods = [
        "hamburger", "chicken", "hot dog", "fries", "macaroni", "pizza",
        "salad", "milk", "ice cream",
    ]

this fails:

 cost = Containers.DenseAxisArray(
         [2.49, 2.89, 1.50, 1.89, 2.09, 1.99, 2.49, 0.89, 1.59],
        foods
    )

with the message

"Failed to show value:

MethodError: no method matching tree_data_array_elements(::JuMP.Containers.DenseAxisArray{Float64,1,Tuple{Array{String,1}},Tuple{Dict{String,Int64}}}, ::CartesianIndices{1,Tuple{Base.OneTo{Int64}}}, ::IOContext{Base.GenericIOBuffer{Array{UInt8,1}}})

Closest candidates are:

tree_data_array_elements(::AbstractArray{var"#s10",1} where var"#s10", !Matched::AbstractArray{I,1}, ::IOContext) where I<:Integer at /Users/nsmith/.julia/packages/Pluto/dcxnF/src/runner/PlutoRunner.jl:640

  1. tree_data(::AbstractArray{var"#s10",1} where var"#s10", ::IOContext{Base.GenericIOBuffer{Array{UInt8,1}}})@PlutoRunner.jl:676
  2. show_richest(::IOContext{Base.GenericIOBuffer{Array{UInt8,1}}}, ::Any)@PlutoRunner.jl:590
  3. #sprint_withreturned#29(::IOContext{Base.DevNull}, ::Int64, ::typeof(Main.PlutoRunner.sprint_withreturned), ::Function, ::JuMP.Containers.DenseAxisArray{Float64,1,Tuple{Array{String,1}},Tuple{Dict{String,Int64}}})@PlutoRunner.jl:549
    4 #format_output_default#17(::Pair{Symbol,Dict{Tuple{UInt64,Int64},Int64}}, ::typeof(Main.PlutoRunner.format_output_default), ::Any)@PlutoRunner.jl:474
  4. #format_output#18(::Pair{Symbol,Dict{Tuple{UInt64,Int64},Int64}}, ::typeof(Main.PlutoRunner.format_output), ::JuMP.Containers.DenseAxisArray{Float64,1,Tuple{Array{String,1}},Tuple{Dict{String,Int64}}})@PlutoRunner.jl:491
  5. formatted_result_of(::Base.UUID, ::Bool, ::Nothing)@PlutoRunner.jl:416
  6. top-level scope@none:1
    "

Why is the behavior different in Pluto than other environments? Pluto error? JuMP error? PEBKAC error?

@fonsp fonsp added display & PlutoRunner & AbstractPlutoDingetjes.jl other packages Integration with other Julia packages labels Jan 5, 2021
@fonsp
Copy link
Owner

fonsp commented Jan 5, 2021

Use Text(cost) to see the value until this is fixed

@fonsp fonsp closed this as completed in 2239865 Jan 30, 2022
pankgeorg added a commit that referenced this issue Feb 8, 2022
> Try this release in your browser! _(Available 30 minutes after the release)_
>
> <a href="https://binder.plutojl.org/v0.18.0/"><img alt="Binder logo" src="https://mybinder.org/badge_logo.svg"></a>

**Generate your own binder links using [pluto-on-binder.glitch.me](https://pluto-on-binder.glitch.me/)!**

[Diff since v0.17.7](v0.17.7...v0.18.0)

**Merged pull requests:**
- Make document currentscript work (#1765) (@dralletje)
- don't count logs messages multiple times for pluto-logs width (#1843) (@Pangoraw)
- Pattern matching system for lezer code (#1849) (@dralletje)
- minor fix: Tables integration caused method ambiguation for Union{}[] (#1851) (@16bitmood)
- Fix #1852, relocatable changes for sysimage usage. (#1853) (@MichaelHatherly)
- Re-enable parseMixed (#1855) (@pankgeorg)
- DOI in REAMDE for citation (#1864) (@rikhuijzer)
- Use pkgdir instead of pathof (#1867) (@rikhuijzer)
- Hide banner in CI (#1868) (@rikhuijzer)
- Server-side events as configuration (#1871) (@ctrekker)
- fix is_stdlib() for nightly and enable nightly tests (#1874) (@Pangoraw)
- Awesome! Line wrapping! (#1876) (@dralletje)
- respect maxlog keyword for logs, fixes #1858 (#1877) (@Pangoraw)
- allow .. as an identifier, fixes #1875 (#1878) (@Pangoraw)
- Server start event (#1882) (@ctrekker)
- Julia 1.6 minimum (#1885) (@fonsp)
- New heuristic to skip intermediate bond values (#1892) (@fonsp)
- Send queued bond changes when last script finishes (#1898) (@fonsp)

**Closed issues:**
- Pkg.jl will corrupt itself on Windows (#671)
- Failure creating JuMP DenseAxisArray (#806)
- Frontend tests fail too often (#1234)
- Open multiple notebooks at start and without browser (#1278)
- Segmentation faults on Julia 1.7 M1 (#1722)
- Table of content overlaps text in static HTML (#1770)
- Pluto hangs when cell contains `(md" ", md"$t")` (#1800)
- Cell drag drop broken in Linux Chrome v97 (#1809)
- Tables integration causes method ambiguities for `pluto_showable` (#1815)
- Segfault with CSV, SQLite, tables (M1) (#1842)
- Use RelocatableFolders.jl instead of project_relative_dir to allow sysimages (#1852)
- Logging doesn't respect `maxlog` (#1858)
- TOC in dark mode is still light when aside (#1860)
- ProgressLogging: suppressed logging in Turing.jl (#1862)
- Cannot update to version 0.17.7 (#1869)
- Stdlib packages marked as not found (#1872)
- EllipsisNotation.jl (`randn((10,10))[1, ..]`) does not work (#1875)
- Too many intermediate bond values (#1891)
pankgeorg added a commit that referenced this issue Feb 8, 2022
> Try this release in your browser! _(Available 30 minutes after the release)_
>
> <a href="https://binder.plutojl.org/v0.18.0/"><img alt="Binder logo" src="https://mybinder.org/badge_logo.svg"></a>

**Generate your own binder links using [pluto-on-binder.glitch.me](https://pluto-on-binder.glitch.me/)!**

[Diff since v0.17.7](v0.17.7...v0.18.0)

**Merged pull requests:**
- Make document currentscript work (#1765) (@dralletje)
- don't count logs messages multiple times for pluto-logs width (#1843) (@Pangoraw)
- Pattern matching system for lezer code (#1849) (@dralletje)
- minor fix: Tables integration caused method ambiguation for Union{}[] (#1851) (@16bitmood)
- Fix #1852, relocatable changes for sysimage usage. (#1853) (@MichaelHatherly)
- Re-enable parseMixed (#1855) (@pankgeorg)
- DOI in REAMDE for citation (#1864) (@rikhuijzer)
- Use pkgdir instead of pathof (#1867) (@rikhuijzer)
- Hide banner in CI (#1868) (@rikhuijzer)
- Server-side events as configuration (#1871) (@ctrekker)
- fix is_stdlib() for nightly and enable nightly tests (#1874) (@Pangoraw)
- Awesome! Line wrapping! (#1876) (@dralletje)
- respect maxlog keyword for logs, fixes #1858 (#1877) (@Pangoraw)
- allow .. as an identifier, fixes #1875 (#1878) (@Pangoraw)
- Server start event (#1882) (@ctrekker)
- Julia 1.6 minimum (#1885) (@fonsp)
- New heuristic to skip intermediate bond values (#1892) (@fonsp)
- Send queued bond changes when last script finishes (#1898) (@fonsp)

**Closed issues:**
- Pkg.jl will corrupt itself on Windows (#671)
- Failure creating JuMP DenseAxisArray (#806)
- Frontend tests fail too often (#1234)
- Open multiple notebooks at start and without browser (#1278)
- Segmentation faults on Julia 1.7 M1 (#1722)
- Table of content overlaps text in static HTML (#1770)
- Pluto hangs when cell contains `(md" ", md"$t")` (#1800)
- Cell drag drop broken in Linux Chrome v97 (#1809)
- Tables integration causes method ambiguities for `pluto_showable` (#1815)
- Segfault with CSV, SQLite, tables (M1) (#1842)
- Use RelocatableFolders.jl instead of project_relative_dir to allow sysimages (#1852)
- Logging doesn't respect `maxlog` (#1858)
- TOC in dark mode is still light when aside (#1860)
- ProgressLogging: suppressed logging in Turing.jl (#1862)
- Cannot update to version 0.17.7 (#1869)
- Stdlib packages marked as not found (#1872)
- EllipsisNotation.jl (`randn((10,10))[1, ..]`) does not work (#1875)
- Too many intermediate bond values (#1891)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
display & PlutoRunner & AbstractPlutoDingetjes.jl other packages Integration with other Julia packages
Projects
None yet
Development

No branches or pull requests

2 participants