mastrof / MicrobeAgents.jl

Agent-based modeling of microbial motile behavior via Agents.jl
MIT License
2 stars 1 forks source link

Use dispatch instead of manual branching #90

Closed Tortar closed 1 week ago

Tortar commented 4 months ago

Hi @mastrof, how is it going? This is just to let you know about this new possibility in MixedStructTypes :-)

mastrof commented 4 months ago

Hey :) Microbes are keeping me busy in the lab, but I have a few projects going that will finally make good use of this library.

Yes I had a quick look at MixedStructTypes and adopted it immediately, great job! I had actually used @dispatch initially but I think Julia was complaining during precompilation. Can't recall exactly, I think it was just a warning that it could not precompile the function. I did not look at the internals but I guess it's sort of expected if the macro tries to "rewrite" the function during package compilation. Everything was still working as expected ofc but I was on a bit of a rush and went for the least effort path, so just used branching instead to avoid the warning. If you load the library using the @dispatch-ed function I think you'll get the same warning. If not I'll check again

Tortar commented 4 months ago

simulated microbes clearly require less work ahah.

I find this package rather interesting anyway, have you thought on making an announcement on discourse? Maybe someone will show up to help you, unfortunately I'm not a biology guy so I can't :D

Anyway, thanks for letting me know of the issue! Indeed I tried to dev this branch and it is as you say :( Fortunately, I have some tricks under my belt to tackle this, so hopefully as soon as I find the time, this shoud be solved.

Tortar commented 3 months ago

Hi @mastrof, I released a new renamed version of the package which also solved this issue, now it should work fine!

Tortar commented 3 months ago

mmmh, not sure why is it failing, because everything works fine locally

Tortar commented 3 months ago

Could you run the workflow again?

codecov[bot] commented 1 week ago

Codecov Report

Attention: Patch coverage is 81.81818% with 2 lines in your changes missing coverage. Please review.

Project coverage is 38.58%. Comparing base (0498af4) to head (a4dde09). Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/microbe_step.jl 50.00% 1 Missing :warning:
src/motility.jl 88.88% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #90 +/- ## ========================================== + Coverage 38.03% 38.58% +0.54% ========================================== Files 23 23 Lines 560 565 +5 ========================================== + Hits 213 218 +5 Misses 347 347 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.