Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 13:46
    mfherbst synchronize #551
  • 13:46

    mfherbst on eneops_refactor

    Review (compare)

  • 13:30
    mfherbst synchronize #551
  • 13:30

    mfherbst on eneops_refactor

    Refactor ene_ops interface Annotate more types in operators Fixes and 2 more (compare)

  • 11:46

    mfherbst on gh-pages

    build based on 9fd77d2 (compare)

  • 11:22

    mfherbst on kpoint_refactor

    (compare)

  • 11:22
    mfherbst closed #552
  • 11:22

    mfherbst on master

    Remove model backreference from… (compare)

  • 10:15
    mfherbst commented #552
  • 10:13
    mfherbst auto_merge_enabled #552
  • 10:13
    mfherbst synchronize #552
  • 10:13

    mfherbst on kpoint_refactor

    review (compare)

  • Dec 05 17:06
    mfherbst synchronize #552
  • Dec 05 17:06

    mfherbst on kpoint_refactor

    Update docs (compare)

  • Dec 05 17:04
    mfherbst synchronize #552
  • Dec 05 17:04

    mfherbst on kpoint_refactor

    Opportunity for enumerate Save on computing qs (compare)

  • Dec 05 16:49
    mfherbst synchronize #552
  • Dec 05 16:49

    mfherbst on kpoint_refactor

    Opportunity for enumerate (compare)

  • Dec 05 16:38
    mfherbst synchronize #552
  • Dec 05 16:38

    mfherbst on kpoint_refactor

    Save on computing qs (compare)

Louis Ponet
@louisponet
so then if I throw in a string and I get an error that the type of my argument is not right, I know
but getting an error from somewhere inside the function body I think have to open an editor find the body and what it's trying to do to know what I'm supposed to throw in
Michael F. Herbst
@mfherbst
again it's a bit the question of what you want.
yes I agree
I mean we check a bit more strongly on the real high-level interfaces (I think)
well on the other hand you have examples to see what is the right way to do stuff and other documentation
Louis Ponet
@louisponet
One example of something like this I actually ran into while doing the spglib was this darned Int32 vs Int64 in the symops for getting the stabilized kmesh
Michael F. Herbst
@mfherbst
my point is: Either you do low-level hacking and then you have to look at the code or you stay on the surface and then you follow examples to see what should be done
Ok what happened?
Louis Ponet
@louisponet
half a day I wasted trying to call it with the Int64's from julia (which is why originally I added the ::AbstractArray{Int32} type in anger)
Michael F. Herbst
@mfherbst
ah but it's C types
Louis Ponet
@louisponet
in the last function inside the spglib.jl
right and I was like, okay now nobody will be fooled again and just get an error that their array doesn't contain Int32's
Michael F. Herbst
@mfherbst
I see
on the other hand I could argue this is not a Julia / DFTK issue, but a C / spglib issue
Louis Ponet
@louisponet
but in line with the philosophy of the code I removed that and just converted it to Int32's when they're not
Michael F. Herbst
@mfherbst
because really it is the interface
Louis Ponet
@louisponet
certainly
Michael F. Herbst
@mfherbst
yes talking to other languages is a point where you need to type-annotate eventually
Louis Ponet
@louisponet
but then adding the type does save you from a mistake
Michael F. Herbst
@mfherbst
there I agree
yes and no
alternatively you make the interface julia-esc and internally ensure to convert to whatever the C layer wants
that's what I meant by not bleeding out the c types by the way
Louis Ponet
@louisponet
yes indeed
Michael F. Herbst
@mfherbst
so ideally the lowest julia layer before calling into c completely abstracts that and as a result does not care whether it is an Int32 or an Int64
Louis Ponet
@louisponet
so to me it feels like the real julian way would be something like having one lowest level function that only allows in the Int32 arrays,
and a same named function for other types that converts first then calls that lowest one
Michael F. Herbst
@mfherbst
yes or you just have one function without types annotated and explicitly convert to the c-type before doing the ccall
if the conversion fails it will bail out either way
Louis Ponet
@louisponet
while the pythonesk way would take in anything and try to convert to the right stuff inside the function, do you know what I mean ? Often in python code I see a lot of if/else figuring out what people called the function with and then converting to what you want to use inside it
Michael F. Herbst
@mfherbst
yes
you mean the if isinstance ... stuff
Louis Ponet
@louisponet
exactly
Michael F. Herbst
@mfherbst
yes exactly that's what Julia tries to avoid by being generic in the interface and by multiple dispatch where you need to be specific
well you can really replace tries by succeeds :smile:
Louis Ponet
@louisponet
hehe yes
One question with respect to the tests
if I would get the wrong balanced reciprocal mesh, would the tests fail?
Michael F. Herbst
@mfherbst
what do you mean by "balanced reciprocal mesh" the monkhorst-pack mesh?
Louis Ponet
@louisponet
yes
inside bzmesh_ir_wedge
Michael F. Herbst
@mfherbst
hopefully
I mean this whole symmetry business is a bit tricky and we've had edge cases before, which were not covered
we test that you get the same results with and without symmetry for a couple of cases
so if you did something major wrong in the symmetry deduction and in getting the irreducible mesh that we would detect that, yes
but subtle things could remain
Louis Ponet
@louisponet
okay, because I remember before I did the right thing, it would not fail but give a lot of the info messages that some reducable kpoints could not be generated from spglib
Michael F. Herbst
@mfherbst
yes indeed
we explicitly check spglib gives us the correct symmetries