Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • May 27 09:13
    evhub closed #663
  • May 27 09:13
    evhub labeled #663
  • May 27 08:55
    evhub opened #664
  • May 27 08:55
    evhub milestoned #664
  • May 27 08:55
    evhub labeled #664
  • May 27 07:14
    evhub labeled #663
  • May 27 07:14
    evhub milestoned #663
  • May 27 07:14
    evhub opened #663
  • May 27 06:33
    evhub demilestoned #662
  • May 27 03:59
    evhub milestoned #662
  • May 27 03:59
    evhub opened #662
  • May 27 03:59
    evhub labeled #662
  • May 25 22:07
    evhub labeled #661
  • May 25 22:07
    evhub labeled #660
  • May 25 22:04
    JacobFV opened #661
  • May 25 21:54
    JacobFV edited #660
  • May 25 21:48
    JacobFV opened #660
  • May 12 23:21
    evhub labeled #659
  • May 12 23:11
    JacobFV opened #659
  • Apr 23 21:14
    evhub closed #658
Peter Henry
@mosbasik
cool, thanks for the response. I'll read with an eye to how I might improve things then.
Juan Castillo
@cfuendesign
image.png

Hey! I tried installing coconut through "pypy3 -mpip install coconut" and, despite the install looking like it went well, "coconut -h" isn't recognized as a command.

I'm an absolute beginner in both pypy3 and coconut, so feel free to correct me.

Juan Castillo
@cfuendesign
Ah, running coconut -h directly from pypy3's scripts folder did the trick.
image.png
Evan Hubinger
@evhub
@cfuendesign Yeah, you need to add the scripts folder to your PATH environment variable. See: https://datatofish.com/add-python-to-windows-path/
Alternatively, you can always just do pypy3 -m coconut -h.
Ivan Cheung
@ivanmkc

Beginner here!

Looking forward to using Coconut but am stumped by something simple.

I'm trying to unpack my parameters (key, value) passed into the map function:

{"A": 1, "B": 2, "C": 3}.items() |*> map$((key, value) -> value) |> list |> print

This works but is "uglier":

{"A": 1, "B": 2, "C": 3}.items() |> map$(key_value -> key_value[1]) |> list |> print
Expected output: [1, 2, 3]
Any help is appreciated :) I'm using Python 3 btw since I know tuple deconstruction changed at one point.
Ivan Cheung
@ivanmkc
Here's another version using a statement lambda, but also not quite as nice as I'd like:
(
{"A": 1, "B": 2, "C": 3}.items() 
    |> map$(def (key_value) -> key, value = key_value; value) 
    |> list 
    |> print
)
Ivan Cheung
@ivanmkc
I know this would work, but I actually want the parameters to be named and unpacked so I can reference either of them (even though I only use "value" in this example):
{"A": 1, "B": 2, "C": 3}.items() |> map$(-> _[1]) |> list |> print
Evan Hubinger
@evhub
@ivanmkc Here are some options that you might like:
d = {"A": 1, "B": 2, "C": 3}
d.items() |> starmap$((k, v) -> v) |> list |> print
d.items() |> map$(def ((k, v)) -> v) |> list |> print
d.items() |> map$(.[1]) |> list |> print
Ivan Cheung
@ivanmkc
Thanks! This is perfect.
Thurston Sexton
@tbsexton

@GianpieroCea Saw your question about data science.

I haven't seen any but I will say that, barring the lack of LSP that keeps me mostly using coconut for prototyping in the notebook, i use coconut constantly for data science. I love what it's done for the maintainability of my code, as well.

So with that, though I've avoided using coconut for codebases that require collaboration (since not many folks can write/read it right away), I would love to start a coconut-for-data-science tutorial.

Been learning/using jupyter book and that could be a great way to do something fast and pretty. let me know if you want to join a repo where we can plan out e.g. key contents and case studies, and I can help adding code based on my irl experience.

same goes for anyone else! :)
pigs
@pigs:riot.firechicken.net
[m]

I'm trying to setup coconut inside Databricks and came across a bug when trying to use the coconut magics:

TypeError: run_cell() missing 1 required positional argument: 'raw_cell
`

However, looking at the backtrace it is clear that the positional argument was given ipython.run_cell(compiled, shell_futures=False)

Evan Hubinger
@evhub
@pigs:riot.firechicken.net Strange. Can you raise an issue and include the traceback and ipykernel version (also anything else that might help me replicate it)?
Jason O.
@puruzio
I am trying coconut as the kernel_name for Papermill and it complains like this. Is there a way to fix this? coconut3 does show up in jupyter kernelspec list.
No parameter translator functions specified for kernel "coconut3' or language 'coconut'
Evan Hubinger
@evhub
@puruzio Should be fixed if you pip install -U coconut-develop (see #658).
Jason O.
@puruzio
Thank you, but the issue still persists for some reason. Same error message.
Evan Hubinger
@evhub
@puruzio Can you put exactly what you did and what versions you were on in the linked issue?
Jason O.
@puruzio
@evhub Sure. I uninstalled the Coconut 1.6 version, and installed coconut-dev 2.0 using the command you mentioned above.
Jason O.
@puruzio
@evhub Never mind. It's working! I accidentally installed coconut outside of venv.
dincio
@dincio:matrix.org
[m]
hello all
I'm very interested in learning coconut, so I was wandering if it works with poetry
Evan Hubinger
@evhub
@dincio:matrix.org should work fineā€”just compile your coconut to python before you run whatever poetry commands you want to run