Better HN
topnewbestaskshowjobs
Log inSign up

physicsguy

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

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

comment 2y ago · link · parent

Any IT transformation project like this is always hampered by people wanting customisations. Those customisations are usually to support Janet in office A who demands that she damn well isn't going to make changes to her workflow that she's done since she started in 1995.

comment 2y ago · link · parent

You can seed with JSON files as "fixtures" and run `python manage.py loaddata fixturename`.

The thing I wish Django had better OOTB support for is background tasks, I've not used it but I understand this is very well done in Rails and Laravel.

comment 2y ago · link · parent

Why would Django move away from an ORM that works, at scale, in millions of deployed websites? They'd have to support both for many years in any case.

> a sizeable share of the community deems inferior

Well, yeah, SQLAlchemy is standalone, you can use it in a lot more situations than Django's ORM in practice, because you're not tied to using it in a Django site. But that doesn't mean it's "better"

comment 2y ago · link · parent

I've had this debate with someone recently, as soon as you actually want to use FastAPI/Flask in something that's not an internal only microservice, you end up building Django on top of it anyway ad-hoc way. It also ends up in more of a mess, because while Django doesn't enforce a code structure as such, the default way of doing things is fairly good.

The main thing I miss about Django is always the DB migrations in any case. I found that pattern to be very flexible and very powerful.

comment 2y ago · link · parent

When I first learnt Django I sometimes felt like that, but I actually found the source code for it and DRF to be very readable, to the point that it's very obvious where they expect you to step outside the guardrails.

comment 2y ago · link · parent

I totally agree with you, but there've been employees I've managed in the past who loved to go off and get distracted with anything they judged "useful", often at the expense of their actual work. That's something to be managed rather than measured by metrics.

comment 2y ago · link · parent

The main issue with code metrics is that they're easy to game, and they're not necessarily an indicator of anything.

In my day job I just made a big change across many microservices updating a core dependency library, so last week it looks like I've done about 50x more work than I have any other week, but that's because I scripted the update, it's not a reflection of the actual work I did at all.

comment 2y ago · link · parent

FEniCs is mostly used by academic researchers, I used it for FEM modelling in magnetic for e.g. where the sorts of problems we wanted to solve you can’t do in a commercial package.

comment 2y ago · link · parent

You can export other CAD meshes for use in it

comment 2y ago · link · parent

Have a look at FEniCs to start with.

comment 2y ago · link · parent

I’m the same with Django.

I’ve found that perf issues were much more often caused by the DB queries than by Django itself.

comment 2y ago · link · parent

OpenCL itself is kinda fine, but the libraries never existed because every academic from postdoc up could get a free NVidia card. You literally filled a form out and they sent you it.

comment 2y ago · link · parent

> It must however be daunting to be a theoretical physicist right now. It seems like the field has been in a standstill for years.

The general public don't really understand where most physicists work. The largest subfield of Physics is really in condensed matter, where (depending on how you count it) somewhere like 30-50% of physicists work, and where there is plenty of interesting theory work. High energy physics is the next biggest subfield, but much of it is experimental, and then you get into "classical physics" like acoustics, optics, etc. Astrophysics is relatively smaller. There's also nuclear, plasma, fusion and then a whole host of interdisciplinary work like biophysics, materials science, etc. Especially with interdisciplinary work, people often do bits and pieces throughout their career, not everyone sticks strictly to a single subfield.

There's plenty of interesting theoretical physics work in pretty much all of these fields. Not everyone works on grand problems of the universe!

comment 2y ago · link · parent

In the areas I've worked these sorts of cases would have been picked up by tests, and especially checking for correctness of output between different optimisation levels. But I can concede that that's perhaps not the standard sort of workflow for many C/C++ developers.

comment 2y ago · link · parent

Left a comment on another reply, but as I said there, there's a big difference in approach because restrict usually only gets sprinkled in on very few functions, but it doesn't mean it's not used.

comment 2y ago · link · parent

It's not used much in a sense that it's applied to very few functions, but it is well known and widely used in limited circumstances. The bugs in LLVM (and GCC) are basically because Rust is using aliasing much more widely than it ever has been in most C programs.

Take for e.g. this:

    void add(double *A, double *B, double *C, int N) {
        for(int i = 0; i < N; i++) {
            C[i] = A[i] + B[i];
        }
    }
You generally wouldn't find many C developers sprinkling restrict in on functions like this, since that function could be useful to someone using add on two overlapping arrays.

On the other hand, someone writing a ODE solver in a scientific code might write a function like this, where it would never make sense for the memory locations to overlap:

    void RHS(double* restrict x, double* restrict xdot, int N, double dt) {
        for(int i = 0; i < N; i++) {
            xdot[i] = -x[i]/dt;
        }
    }
In those sorts of circumstances, it's one of the first performance optimisations you might reach for in your C/C++ toolkit, before starting to look at for e.g. parallelism. It's been in every simulation or mathematical code base I've worked on in 10+ years at various different academic institutions and industry companies.

comment 2y ago · link · parent

> aliasing can’t happen unless both references are read only

Other languages have long had aliasing, Fortran for one. C and C++ have the restrict keyword though obviously it's a programmer guarantee there and is less safe, since if the user of the function does pass the same memory ref offset for e.g. the optimisation is not safe.

comment 2y ago · link · parent

It’s in pretty much every simulation code base I’ve worked on (both academic + industry)

comment 2y ago · link · parent

We still have access to GH Copilot through an enterprise deal, it's a bit hobbled though vs the full thing since there's extra filters that MS offer.

comment 2y ago · link · parent

My large corporate has just declined continuing its Copilot 365, citing that there wasn’t much usage and people didn’t find it very useful.

comment 2y ago · link · parent

Arxiv isn't just Physics at all, historically it's always been a big place for Maths and CS too.

comment 2y ago · link · parent

Not too dissimilar for me at Birmingham, we had tutorials ~weekly. There were weekly problem sheets that counted for 10% of the grade though.

Similar re: exams, they were available but sticking rigidly to them didn’t help much.

comment 2y ago · link · parent

I think in practice every chip since about 2008 or so has supported SSE4.1

comment 2y ago · link · parent

Ooh, I published in Scientific Reports during my PhD. It actually has my highest cited paper!

I can't remember where the original paper was submitted to, but it's worth saying that Nature allow basically any paper submitted to their Nature journals to be transferred to Scientific Reports, which is open access. So if it's been rejected, it's a bit of a path of least resistance to let it go there rather than trying again in a better rated journal like Phys Rev A-E or Phys Rev Letters, which also requires you to reformat the whole thing to their standards.

I don't think anyone really thinks it's a high impact journal or anything. The review is as good as the reviewers ultimately. I've reviewed papers for it and recommended rejection and the paper has been rejected. That's more than I can say for other journals.

comment 2y ago · link · parent

I don’t really understand the point of having two backends for such a simple application.

comment 2y ago · link · parent

Bass drop

I love the glimpses that give away the British people on here. Sometimes I feel like I’m the only one but this thread has brought them all out

comment 2y ago · link · parent

Yeah it’s a game you play as kids.

comment 2y ago · link · parent

Pandera is quite nice for at least forcing validation in Pandas for this

comment 2y ago · link · parent

It’s become trendy to slam on the U.K., often by its citizens, but I think the doom and gloom is overdone. Nowhere more is that the case than in techie circles where people earning higher salaries than they would in most other European countries moan about how it’s a shithole.

Fundamentally it’s still a good place to live. We have a good education system. Sure, you might have to choose between a longer commute or leaving London and accepting a bit of a lower salary in a different city but that’s true the world over.

comment 2y ago · link · parent

There’s a guy who I work with who went to work for a crypto place that then exploded (as they all tend to do). He had quite a difficult time finding a new position, and was asked multiple times about working for a scammy company. So perhaps don’t underestimate the negative effect it can have career wise…
1
202122
49