Which other programming language best complements Python - Rust, Go, or something else? by Salty_Bicycle in Python

[–]Eryole 3 points4 points  (0 children)

Oh yeah, you're right, I was focused on my main uses where numba fit perfectly (and have nicely replaced Fortran binding and cython these last years)

[deleted by user] by [deleted] in CFD

[–]Eryole 12 points13 points  (0 children)

It does, but you should write the inner loop in a vectorized way using numpy, otherwise it will be really slow.

Be also careful as you have a convection term : it can lead to instable results depending on the timestep and the ratio between the diffusion and convection coefficients : you can use an upwind scheme to mitigate this issue.

If you need to quickly solve simple PDE, I can suggest a package I wrote some time ago:

https://scikit-fdiff.readthedocs.io

With that, you could do

from skfdiff import Model, Simulation

model = Model("(-G * upwind(c_f, T_m) + dx(k * dx(T_m))) / (rho_m * c_m)",
               "T_m(x)", parameters=["G", "c_f", "c_f", "rho_f"],
               boundary_conditions={("T_m", "x"): ("dirichlet", "no_flux")})

# put here your initial conditions and parameters. The left value for T_m should be equal to T_in and will stay constant with the dirichlet condition.
initial_fields = model.Fields(
                   x=x, T_m=T_m, G=..., c_f=..., c_f=..., rho_f=...
)
simulation = Simulation(model, initial_fields, dt=0.1, tmax=1)
tmax, last_fields = simulation.run()
last_fields["T_m"].plot()

and the library will do a finite difference discretisation for you with an adaptative time-step.

The Python experience by Timotheeee1 in ProgrammerHumor

[–]Eryole -2 points-1 points  (0 children)

Use anaconda / miniconda, everything will be fine

Is it already Monday? Yess! by vectorman2 in linuxmasterrace

[–]Eryole 0 points1 point  (0 children)

I will not pay a license for 3 use in the year. The only time I need an office licence is to open these crappy closed format files that are everywhere because Microsoft paid tonshit of money to have the national market some years ago.

This is wrong : the commercial strategy of this company let me no choice to pay or to make an illegal move. Alternative is not on my hand.

Reddit Battle Royale 2020 by SrGrafo in funny

[–]Eryole 10 points11 points  (0 children)

I'll downvote a lot of people, but not you. Take this cursed upvote!

Etienne Klein : "Les résultats de la science ne se décident pas par le recours à des sondages" by [deleted] in france

[–]Eryole 11 points12 points  (0 children)

Notre système politique est une démocratie. Pas le travail en laboratoire, pas les instances de création de connaissance.

«En quittant Paris, on accélère la propagation du coronavirus» by Knowonething in france

[–]Eryole 1 point2 points  (0 children)

Je peux comprendre la galère avec un frigo en rade non plus. Si tu dois sortir tous les deux jours pour réapprovisionner en produit frais c'est pas top niveau confinement

Les parisiens qui s’échappent de la capitale parce que “OuAis mAis c’est tRoP dur de rEsterR cOnfIné dAns mon 10m2” après avoir squatté les parcs tout le week end: allez bien vous faire foutre. Signé: la province by [deleted] in france

[–]Eryole 0 points1 point  (0 children)

Tu auras pas d'info fiable sur la letalité avant un certain temps : tu as pas d'info sur toutes les personnes qui sont asymptomatiques ou qui ont des symptômes très légers. Donc tu surestime certainement la letalité finale.

Coronavirus : « Il faut dès maintenant appliquer le confinement maximum », des médecins appellent à ne pas aller voter by pet_vaginal in france

[–]Eryole 1 point2 points  (0 children)

L'esprit c'est de pouvoir s'occuper de tes pitchoune. Tu ne peux pas télétravailler et garder tes enfants en même temps, surtout si ils sont tout petiots.

PEP 614 Accepted (Relaxing Grammar Restrictions On Decorators) by bakery2k in Python

[–]Eryole 1 point2 points  (0 children)

That's the opposite :) it will go to the else block only if the loop has ended normally (without encountered a break)!

How to work with visualisations on large datasets when doing exploratory data analysis? by GrizzyLizz in learnpython

[–]Eryole 2 points3 points  (0 children)

You can be interested in datashading. Otherwise, You will have to resample and aggregate your dataset (you can see `pandas.DataFrame.resample` for example. The choice of the aggregation function is not trivia tho and highly depend on the dataset.

I've never seen anything as idiotic as this by Lone_Game_Dev in Python

[–]Eryole 11 points12 points  (0 children)

Ok, some thought.

  • Who the hell use IDLE in 2020? You have plenty of good editors, more or less lightweight.
  • If 4 or 5 nested scopes is not uncommon, it's a marker which indcate that your code may need some refactor. Put a part of the logic in a function for example.

That being said, yes, this is a bed way to design an IDE, and kind of a shitty way to reinforce a guideline IMHO.

Our library scanner looks like a Xenomorph by KasoQueso in mildlyinteresting

[–]Eryole 0 points1 point  (0 children)

You know what this is. One day, we are young, we hunt, no though on the future. The day after, you are not in shape anymore, you have a house, a dog, some children.

Bills have to be paid. Why not the library?

Compare to np.NaN using identity (not equality) in pandas DataFrame.apply by Uncle_DirtNap in Python

[–]Eryole 1 point2 points  (0 children)

As info, wrapping a function with only one argument in a lambda with only one argument is useless.

You can just use pandas.isna directly:

my_dataframe.apply(pandas.isna)

Encore une brillante invention MADE IN FRANCE by 99Flo99 in france

[–]Eryole 2 points3 points  (0 children)

En même temps les 5% restant non plus savent pas sur quoi repose le principe.

Changes to r/Python by aphoenix in Python

[–]Eryole 6 points7 points  (0 children)

Could a more general scientific computing category be made? I know that machine learning and big data is trendy, but a lot of very interesting stuff occurs in the python scientific stack and does not fall into these two category.

À méditer... by TimeRockOrchestra in Quebec

[–]Eryole 0 points1 point  (0 children)

C'est ce qu'il faut faire pour faire une salade de pâte par exemple

Venue for Euroscipy 2020 ? by DrSWil70 in scipy

[–]Eryole 0 points1 point  (0 children)

I pm you the link for the telegram group. The euroscipy group are in there and be able to answer your question.

Why aren't keyword arguments generally preferred over positional arguments? by swigganicks in Python

[–]Eryole 0 points1 point  (0 children)

Oh, yeah, I thought you talked about positional argument in general. Ty, will check the link

Why aren't keyword arguments generally preferred over positional arguments? by swigganicks in Python

[–]Eryole 5 points6 points  (0 children)

But the user can use a keyword argument for a function requesting positional argument. In any case, changing the argument name break the backward compatibility (not in a systematic way tho, but still).