ContactEngineering / ContactMechanics

Contact mechanics using elastic half-space methods
https://contactengineering.github.io/ContactMechanics/
MIT License
21 stars 5 forks source link

Enh/pipeline function for scanning probe #101

Closed sannant closed 1 year ago

pastewka commented 1 year ago

I am sorry, but we will not compromise API consistency because of the amount of work it appears to be.

I suggest that we write a decorator that turns a function such as the one in this PR into a proper pipeline function. It will then be zero additional work to write actual pipelines.

The pipeline will be of particular importance once we have time-dependence in the code.

sannant commented 1 year ago

Ok makes sense. Can we temproarily merge this and open an issue for that ?

It is holding back a pull request in SurfaceTopography.

pastewka commented 1 year ago

No, we merge when this is fixed. I can do that, but probably not today.

pastewka commented 1 year ago

Sorry, I just saw your comment: Why does SurfaceTopography as an upstream project depend on ContactMechanics? This should not happen. That creates weird interdependencies.

sannant commented 1 year ago

Important detail: the dependency is only in the testing suite. We agreed on this dependency. I agree that a dependency of the package itself would be bad and I would avoid it.

I first used it to test the elastic energy for full contact.

I now use it to test scans with tip artefacts.

sannant commented 1 year ago

No, we merge when this is fixed. I can do that, but probably not today.

Ok we can wait a few days.

pastewka commented 1 year ago

Important detail: the dependency is only in the testing suite. We agreed on this dependency. I agree that a dependency of the package itself would be bad and I would avoid it.

I first used it to test the elastic energy for full contact.

I now use it to test scans with tip artefacts.

Yes, we talked about this but in retrospective it is bad to have this even in testing. Imagine you need to restrict the surfacetopography version in contactmechanics <= some version, then the whole thing breaks.

If you need to the tip artefacts in surfacetopography, maybe the code should be there not here.

sannant commented 1 year ago

Happy to move the tip artefact simulation there.

Concerning the test of computation of the elastic energy against ContactMechanics, it is not too bad if I do these specific tests in the ContactMechanics test suite. I have other tests that should break if the computation of the energy gets wrong

pastewka commented 1 year ago

I've created a decorator that turns a function into a pipeline function with lazy evaluation, see here: https://github.com/ContactEngineering/SurfaceTopography/pull/298

sannant commented 1 year ago

I will remove all the scanning probe stuff but will keep some fixes to the API I additionally did in the branch

sannant commented 1 year ago

Thanks I will implement that. Note that we need to finish the PR in SurfaceTopography before we can merge this one

pastewka commented 1 year ago

Thanks I will implement that. Note that we need to finish the PR in SurfaceTopography before we can merge this one

Did you open a PR? I don't see it.

sannant commented 1 year ago

https://github.com/ContactEngineering/SurfaceTopography/pull/216