I wanted to tell you I pressed like at 00:42, when I realised I'm watching one of the best summaries ever. The cotent as well was great. Very good job, mate.
i believe if you add "Beginning 0:00" to the beginning of the timestamps in the description, youtube will divide the video bar to the partitions of it. edit:typo and grammar mistakes
argh would've saved me sooooo much time had I known about it sooner! Definitely improves code structure right from the onset and I hadn't appreciated how messy your code can get when working with argparse.
Not sure if you’ve become aware of it since making this video, but Python 3 has the built-in `functools` library which has both the `cache` and `lru_cache` functions that can be used as decorators. `lru_cache` takes an argument `maxsize` to specify how many combinations of unique input arguments should have their results cached, and the `cache` decorator is the same but assumes an infinite number of catchable results. This has the benefit of not requiring redis nor an external plugin, but the downside is the cache only exists in that runtime of python.
I made a separate video on this. These in memory caching decorators have been around forever but the benefit of Redis Simple Cache is that it can survive a runtime restart.
@@JackofSome oh awesome! I just found your channel (through your Numba JIT video) and have been going through all the videos I'm interested from oldest to newest, so I guess I just haven't gotten there yet. Love what I've been seeing so far!
Your channel and videos are really amazing. Great to continue with AI/ML/Reinforcement and other CS subjects. I am convinced that your are going to have a lot of subscribers. Good luck
Hi Jari and thanks for the great content. Apparently you're using a tiling window manager. Have you considered doing an "abs (min (...))" video on that? By the way, your videos really improved my dev workflow. You introduced me to org-mode, spacemacs, fzf, autojump and vspacecode and, from now on, I could not code without them. You should set up a patreon, I will support you with great pleasure.
Hi. I get a lot of requests for my setup so I guess I should do a video soon. I used to have a patreon but my output is really sporadic so I took it down. If you want to donate you can do that here www.buymeacoffee.com/Ej8qUm5 Or alternatively you can donate to a charity like Humanity First or the Red Cross
One point about floating points getting truncated, the meaningful part of a double is the 16 numbers, the numbers that are truncated are just artifact of the format of floating-point and would not be exactly as given, you can test it with entering this snippet:"a = float('0.1111111111111111111'); print("{:.20f}".format(a)) " Which on my machine give the following output: 0.11111111111111110494 For more information about the issues rising working with floating points, check here: www.topcoder.com/community/competitive-programming/tutorials/representation-of-integers-and-reals-section-1/
Rich is really cool for building beautiful CLI apps, and if I am not mistaken it has it's own progress bars. Also looked for Typer and Loguru, they seem super easy to use
Thanks, a really cool video! I will definitely try some of these libraries out soon. As for the redis cache, do you think there's an advantage to using it over sth like lru_cache?
I tried to use tqdm to implement a file loading progress bar but somehow it just wasn't working out. I could figure out how to pass the total size of the file and see how much has been accessed or read to the package. I'm not even sure what the file type was anymore but if anyone could give an example or some insight, that'd be great. btw @jack, your videos really ARE great. I just came across them today randomly and I love them!
Argh is not really maintained, and I don't see the advantage of redis simple cache over functools' lru_cache. The msgpack homepage has some issues with showing the available implementations as well. Other than that it's pretty interesting! I can recommend APScheduler for a more flexible and powerful scheduler for Python.
Not maintained yes but still perfectly functional, but yes it's probably better to use click or something. As far as I know lru_cache gets scrubbed as soon as the process exits. Is that not the case? Redis cache is persisted to disk. I'd be interested in reviewing the issues with msgpack. I know in the early days they had some problems but haven't encountered any myself. It was a huge boon to a project where I needed a python server to send lots of data over websockets to a webpage.
@@JackofSome Cheers for the reply. Yes click does indeed seem more on top of things! You are right that lru_cache is not persisted across runs, neither is 3.9's unlimited "cache" afaik. But on the other hand it doesn't require any external dependencies, so it's worth a mention I think. Regarding msgpack, I'm just referring to their homepage not displaying anything in the bottom section titled "Languages" and "API". Other than that I think it's a solid option for serializing data that doesn't need human reading.
I'm trying to figure out a good time. With the shelter in place order right now I can't go to the office to do the stream which is what I used to do. Maybe I'll do tutorials first and then do the livestreams for Q&A
Nope. Doesn't persist which is what's different here. I seem to have done a bad job of explaining this because I get this comment a lot. Maybe I should make a video
Has something changed in msgpack? I downloaded the file from the git repo and ran it in python3 and python3.9 and I get a traceback as Traceback (most recent call last): File "c:\temp\ytvideo_python_lib_favs\five_amazing_python_msgpack.py", line 62, in msgpack_example_1() File "c:\temp\ytvideo_python_lib_favs\five_amazing_python_msgpack.py", line 43, in msgpack_example_1 back_from_msgpack = msgpack.unpackb(ftmp) File "msgpack/_unpacker.pyx", line 195, in msgpack._cmsgpack.unpackb ValueError: int is not allowed for map key
I got the same error with msgpack-1.0.2 and patched it like this : back_from_msgpack = msgpack.unpackb(f.read(), strict_map_key=False) Hope this helps!
i have sed lru_cache from functools for cache memory, but you use redis simple cache, i understand that the recently used value it save in redis database, is it true? but is this the case its more powerfull for big data!
Aren't these all in-memory though? I've been meaning to make a python 3 compatible fork of redis cache and maintaining it. Maybe now is the time edit: I reviewed the codebase for cachetools and it's a very nice library. I really like it. But it _is_ still in memory. Even the TTL cache does not persist to disk in any way.
Hi can someone explain when did we realistically need argparse and tqdm becaue from my perspective it seems to not be that useful because python is mainly for backend development right?
That's a very complicated and situation specific question. For my production environment, for example, I use a combination of in memory caching, disk based caching, and redis based caching, all hand written.
Pickle is specific to python whereas msgpack is more like json. Many languages implement the spec and so the data can be easily shared (e.g. I have a 3d visualizer that runs on the web and can communicate with a local process over websockets and send data using msgpack)