NumPy 2.0.0 released (github.com)
from rwnobrega@lemmy.world to python@programming.dev on 16 Jun 2024 14:33
https://lemmy.world/post/16594570

#python

threaded - newest

Alteon@lemmy.world on 16 Jun 2024 15:02 next collapse

We’ll that’s huge. NumPy is fantastic. Had to use it for a bunch of linear algebra calculations for a Mars Atmospheric Descent Calculator. Fully mapped the trajectory and flight path as it entered the Martian Atmosphere. Was a cool little program…

SatouKazuma@programming.dev on 16 Jun 2024 15:22 next collapse

Now this I have to see…!

Alteon@lemmy.world on 16 Jun 2024 21:41 collapse

I’ll see if I can boot it up and send you the output later. It’s been awhile. If I can get it working, I’ll ask you to give me a bunch of inputs (speed, trajectory, altitude, etc) and I’ll send you the output. I had the speed and trajectory calculated every 0.1s so it was relatively accurate. I was planning to add in boosters and parachutes, but I never got that far. The best I can. Give you os how long it takes to plummit into the ground and at what speed lol…

It was pretty cool as it would correctly show orbits and the effect of atmospheric drag if you didn’t fully descend in the first orbit around the planet, so you’d just see it loop around several times until it bled off enough speed to eventually descend into the atmosphere. I think I managed to get coreliolis effects added before I stopped messing with it.

SatouKazuma@programming.dev on 17 Jun 2024 12:23 collapse

I mean, what were all the coefficients you looked at? Your source code would be really cool, assuming you’re wanting to open it up, of course.

dinckelman@lemmy.world on 16 Jun 2024 18:36 collapse

I’ve had a short period, where i had to use it during uni, and it was honestly a pretty solid experience. Unfortunately i can’t say that about MATLAB, as that was a nightmare in every way imaginable

wewbull@feddit.uk on 16 Jun 2024 15:56 next collapse

Furthermore there are many changes to NumPy internals, including continuing to migrate code from C to C++, that will make it easier to improve and maintain NumPy in the future.

I realise that C can be rather low level a lot of the time, but I’m not sure I’d pick C++ to help keep things easy to maintain. It opens up a Pandora’s box of possibilities.

cbarrick@lemmy.world on 16 Jun 2024 16:30 next collapse

With a good style/best-practice guide, C++ can be quite productive of a language to work with.

Those kinds of guides typically define which standard/convention to use and which features not to use (cough exceptions cough).

I highly recommend Google’s C++ style guide: google.github.io/styleguide/cppguide.html.

pankuleczkapl@lemmy.dbzer0.com on 16 Jun 2024 17:36 next collapse

You accidentally added a dot at the end of the link. Here’s the fixed one google.github.io/styleguide/cppguide.html

cbarrick@lemmy.world on 16 Jun 2024 18:04 collapse

I intentionally added a period because it was the end of a sentence.

If your Lemmy app messed it up, then that’s a bug in its markdown parser.

rhymepurple@lemmy.ml on 17 Jun 2024 15:06 collapse

I’m curious about this. The source text of your comment appears that your comment was just the URL with no markdown. For your comment about a markdown parsing bug to be true, shouldn’t the URL have been written in markdown with []() notation (or a space between the URL and the period) since a period is a valid URL character? For example, instead of typing https://google.github.io/styleguide/cppguide.html., should [https://google.github.io/styleguide/cppguide.html.](https://google.github.io/styleguide/cppguide.html) have been typed?

cbarrick@lemmy.world on 17 Jun 2024 16:06 collapse

Huh. This got me curious.

Yes, I did just type a bare URL. Every mature markdown parser I’ve used turns this into a link, and appropriately handles trailing punctuation.

So I went to the spec, and it’s explicitly called out that this is not an autolink. Autolinks must be explicitly surrounded with angle brackets <>.

So yeah \shrug.

spec.commonmark.org/0.31.2/#autolinks

Edit to be clear: This means that both of our markdown parsers are wrong relative to the commonmark spec. But I’ll argue that if a parser is going to attempt to autolink this, then handling trailing punctuation is better than not.

rhymepurple@lemmy.ml on 17 Jun 2024 16:26 collapse

I did not know about autolinks - thanks for the link!

It is interesting how different parsers handle this exact situation. I usually am cautious about it because I typically am not sure how it will be handled if I am not explicit with the URL and additional text.

wewbull@feddit.uk on 16 Jun 2024 18:20 collapse

Do you think a style guide is enough for an open source code base? Contributions could be coming from lots of directions, and the code review process to enforce a style guide is going to be a lot of work. Even rejecting something takes time.

balder1993@programming.dev on 16 Jun 2024 18:55 collapse

This kind of thing can be easily automated nowadays. It’s not really a problem.

sugar_in_your_tea@sh.itjust.works on 17 Jun 2024 04:42 collapse

Yup, we do it for Python and Javascript at work, and I do it on my Rust projects (and my older C projects). I don’t see why C++ should be any more difficult.

sugar_in_your_tea@sh.itjust.works on 17 Jun 2024 04:43 collapse

Honestly, I prefer C to C++ anyway. If they’re going to switch to something, I’d prefer Rust.

But whatever, not my project, not my concern.

gerryflap@feddit.nl on 16 Jun 2024 17:25 collapse

Awesome! Numpy has been such a useful tool during my data science study. Happy to see that they’re not afraid to make some bigger changes.