Better HN
topnewbestaskshowjobs
Log inSign up

physicsguy

3,138 karma · joined Feb 12, 2018 (8y ago) · 1,452 submissions

Former Physicist. Now developer. Have worked in academia, scientific software development.
Submissions

comment 1y ago · link · parent

I think the syntax isn’t that important if I’m totally honest! The library support and ecosystem is much more useful to me than it ever was in MATLAB and tbh I use np.einsum for anything tricky and because performance is better anyway.

comment 1y ago · link · parent

There's now a "FastAPI Cloud" product that the author is working on.

SQLAlchemy just has paid for support, I shouldn't have included it with the others, I must have confused it with something else.

comment 1y ago · link · parent

The freemium model of everything makes me skeptical and reluctant to buy too much into many things.

Bit like Pydantic. It's a JSON parsing library at the end of the day, and now suddenly that's got a corporate backer and they've built a new thing

Polars is similar. It's a faster Pandas and now suddenly it's no longer the same prospect.

FastAPI the same. That one I find even more egregious since it's effectively Starlette + Pydantic.

Edit: Add Plotly/Dash, SQLAlchemy, Streamlit to that list.

comment 1y ago · link · parent

I used MATLAB for about 5 years, and then Mathematica, before switching to Python. I even had a job offer to work at MathWorks in Cambridge in about 2014!

comment 1y ago · link · parent

The predecessors were really popular before it too - MATLAB in engineering in particular, Mathematica also popular in Physics and Maths departments particularly where the symbolic functionality was more useful. I used both in academia and IPython (later renamed Jupyter) was clearly a natural extension of those but open source, and without the baggage of MATLAB (only one function definition per file, etc.)

comment 1y ago · link · parent

I think Julia has largely not solved it because it is clunky to use for purposes other than scientific computing. Python can't be argued to be that, it's very nice for web development as well as scientific computing, the issue is just that for non-scientific computing use cases the perf. isn't great.

comment 1y ago · link · parent

Fused expressions are possible using other libraries (numexpr is pretty good), but I agree that there's a reluctance to use things outside of NumPy.

Personally though I find it easier to just drop into C extensions at the point that NumPy becomes a limiting factor. They're so easy to do and it lets me keep the Python usability.

comment 1y ago · link · parent

> when it works

This is the problem!

comment 1y ago · link · parent

We're 30mph through my village but because it is a 'cut through' the local government deem it to be important and the speed cannot be reduced. Even though we had two cars go round a sharp bend into a tree within a month of each other, in dry conditions.

comment 1y ago · link · parent

I was amazed when I travelled to the US at just how pedestrian hostile it is. I was travelling to a conference in San Diego and it was just impossible to walk safely between where I was staying and where I was going to because this was the road: https://maps.app.goo.gl/G2PeVbEzQyqbgDTN9

comment 1y ago · link · parent

How do you value what they already put into it?

comment 1y ago · link · parent

Julia only came on to my radar in scientific computing (not ML) in about 2015-2016 or so but while I tried it at the time, it was really not very stable and my view was that it was very immature compared to Python’s scientific ecosystem. Looking at the dates, v1.0 came out in 2018 and I remember going to a talk about it at my academic institution where someone showed off the progress and we had a play again in our research group but it still didn’t have many things we needed and the trade offs felt not great as we were heavy users of IPython and then when it came out Jupyter and while Ju stood for Julia the kernel development environment didn’t work so well because rerunning cells could often cause errors if you’d changed a type for e.g.

At the time we were part of the wave I suppose that was trying to convince people that open source Python was a better prospect than MATLAB which was where many people in physics/engineering were on interpreted languages. At least in my view, it wasn’t until much more recently that Julia became a workable alternative to those, regardless of the performance benefits (which were largely workable in Python and MATLAB anyway - and for us at least we were happy developing extension modules in C for the flexibility that the Python interface gave us over the top).

comment 1y ago · link · parent

I’m perfectly familiar with SymPy and it’s great but it doesn’t have methods comparable in performance in stiff PDEs to CVODE, and it’s not parallelised either. CVODES offers sensitivity analysis, ARKODE offers multi rate integrators for systems where the ODE can be decomposed into slow and fast rates, etc. etc. - it’s a much more sophisticated and specialist library.

comment 1y ago · link · parent

I reviewed a paper recently that gave an incorrect definition for one of Maxwell’s equations and then proceeded to use it incorrectly. It got moved to a lower ranked journal rather than rejected outright. That wasn’t the only problem either, half the text was clearly AI generated.

comment 1y ago · link · parent

> then you should assume that a study conducted by people with substantial academic training and deep expertise in the field have also had this thought and incorporated it into how they perform their analysis.

You should sit in some academic meetings and paper drafting e-mail chains! There’s a degree of believing the best in people but in my experience that can unfortunately be misplaced in science.

comment 1y ago · link · parent

What I mean is that (at least in my experience) people are not so commonly writing serious numeric applications in Rust as Python extensions because the numeric libraries on which you'd typically write in a compiled language are not as well developed and are in themselves often thin wrappers over C/C++ code at the moment. When you write an extension library you typically want all the 'slow' stuff to be done in a layer below the interpreted language for performance reasons.

So if you wanted to write a Python Physics library that included, say, time integration with an implicit solver like those SUNDIALS provides (and SUNDIALS is like the gold standard in this area), you have less well used options for the time integration part if you write the extension in Rust as if you do in C/C++. Or you're using the same library anyway.

comment 1y ago · link · parent

That's true but I still don't see that so much because the core libraries are not as mature and often they're just thin wrappers around the C/C++/Fortran API without examples. Just as an example, I'd count this SUNDAILS library as like that: https://docs.rs/sundials/0.3.2/sundials/

Nothing wrong with that as a starting point of course, but it's easier just to compile it as a dependency and look at the core documentation if you're familiar with C++; you'll need to be reading the C++ examples anyway to write Rust code with it.

comment 1y ago · link · parent

Pybind11 seems more popular in my area now. I still like Cython though in terms of the ease of wrapping anything in a Python-y interface.

comment 1y ago · link · parent

Well, to be fair, many many clubs nowadays operate a sharing policy so that if you're banned from a one venue in a city others won't let you in either. It's part of the terms of going in, if you don't agree to it, you don't have to have access.

comment 1y ago · link · parent

It's largely historic these days, there's been various proposals to reform it and other mad rules (e.g. can't get married outside, can't get married after 6pm) but it's not really viewed as high priority.

comment 1y ago · link · parent

> It's very hard to explain why things happen in UK politics without assuming he is trying to tank Labour.

Or they just focused on getting into government with very little plan about what to do when there, and with a particularly inexperienced team (few former cabinet ministers in the elected Labour MPs).

comment 1y ago · link · parent

Cyprus isn't in Europe geographically, it's in Asia.

There are also the various territories of larger countries that aren't - French Guaiana in South America, Canary Islands are off the coast of Africa.

comment 1y ago · link · parent

> shouldn't it be the other way round? if the UK doesn't like something a non-UK company is doing it should be them that go through the trouble of blocking it.

They're clearly working up to this; it's what happened with Pirate Bay, etc.

comment 1y ago · link · parent

> The other limits—involving the king or the courts—are theoretical and, if asserted, would cause their own political crises.

Part of the issue we're in such a political crisis at the moment is the growth and expansion of the court system to block things that politicians try to do. Just to give an example - the European Court of Human Rights has dramatically expanded through case law the Article 3 from a clause intended deliberately to protect people within their own state from inhumane treatment e.g. torture, indefinite imprisonment, to an absolute clause that blocks extradition or deportation of anyone if they're deemed to be at risk in the country they'd be removed to. This was explicitly rejected by the drafting states. The ECHR claimed not to apply to immigration or deportation decisions, and it was only in the late 80s with this case that they changed their position on that with the decision in Soering v United Kingdom (https://en.wikipedia.org/wiki/Soering_v_United_Kingdom). Prior to this they declined to intervene in cases like this. Whether or not you agree with this, it's my view that it is up to politicians to decide on the law that applies to a country, and it's judicial overreach to expand it. Aside from this, people see problems that they think the politicians should be fixing and the country has sleepwalked into a position where these powers have been delegated to unelected bodies (NHS England being at arms-length from the Health Secretary even though people view this as the government's problem to fix, leading to current government abolishing NHS England entirely to try and take control again) and even totally unaccountable private organisations ("can't disclose due to commercial sensitivity" is commonly trotted out in Freedom of Information requests to avoid embarrassing private companies operating public services).

> But there are practical things which could be done by means of constitutional reforms that would not be easy for an incoming illiberal and radical government to undo, at least not quickly. There could be fundamental reform of the House of Lords to extinguish prime ministerial patronage. The Royal Prerogative could be placed on an entirely statutory basis.

The problem is that mucking about with this and putting it on statutory basis is that that can be changed by an Act of Parliament trivially - no Parliament is legally able to bind it's successors. Look for e.g. at the Coalition - they legislated that Parliament would have fixed terms of 5 years in the Fixed Term Parliaments Act, and then the Dissolution and Calling of Parliament Act 2022 was later passed and everything reverted to the old system.

comment 1y ago · link · parent

> Less than 20% of weddings are religious (and a smaller subset of this will be in churches)

That's a likely a fair underestimate because many religious marriages aren't legally valid because of various requirements that the Church of England doesn't have to follow as the state church. In Catholic churches for e.g. they need to register the building, then either appoint the priest as an authorised person or get a registrar to come to every ceremony as in a civil wedding. They do usually do this but most non-Christian religions don't bother with this at all and so the couple end up just having a civil ceremony first and the religious one after.

comment 1y ago · link · parent

I’m from the UK

It does yes but more like in a bad mood. A teenager who is rolling their eyes and making a comment because they’ve been asked not to do something could be described as having a strop.

comment 1y ago · link · parent

In weddings in the U.K. (or at least in England) anyone can attend a wedding - legally they have to be open.

It’s therefore not uncommon if it’s local for more distant friends of family, neighbours, etc. to pop along to the ceremony at invitation of the couple or their parents as a result, but not to be invited to the party part. Sometimes older guests will just come to ceremony too.

comment 1y ago · link · parent

The thing that I find more frustrating than anything is photos of children. I'm not so bothered about myself.

I have a young child - he's two and a half. Most people are considerate and ask if it's OK to take a photo - and I generally say yes if it's friends - but we were at a wedding recently and a staff member, total stranger, at the venue was laughing at him running around and asked if they could take a picture, and then got stroppy when I said no. I just think it's quite strange behaviour to want to take photos of a child you don't know. It's quite different to the professional photographer taking photos for the hosts in my mind, which you basically accept by bringing your kids to an event like that.

A mum at a playgroup just took out phone and started filming my son playing with her child. My wife asked her to stop and she again got quite stroppy, even though the group explicitly said that photos should only be taken with consent in that space!

comment 1y ago · link · parent

This gets asked at basically every wedding I've been to in the UK i.e. there is a professional photographer, please don't take photos of the bride and groom in the church and it still gets ignored. At my own wedding, one of the guests (not even someone invited to the whole day, just a neighbour of my wife's parents who knew her growing up) is leaning out of the aisle with their phone taking photos ruining a load of photos.

It's incredibly frustrating. I also think it's really strange that when something happens in public, the default isn't to look to see if the person isn't OK anymore, it's to pull out a camera phone and start filming.

comment 1y ago · link · parent

I like it but in my experience a lot of teams use them loosely without a type checker, more for understanding than for correctness. Reason for that is largely that it can be difficult to make the checkers happy…
1
8910
49