Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/22 models issue 195 #216

Merged
merged 82 commits into from
Mar 25, 2023
Merged

Feat/22 models issue 195 #216

merged 82 commits into from
Mar 25, 2023

Conversation

sannant
Copy link
Collaborator

@sannant sannant commented Jul 28, 2022

No description provided.

@pastewka
Copy link
Contributor

Can you explain to me what this does and how it is different from the current fourier_synthesis function?

@sannant
Copy link
Collaborator Author

sannant commented Jul 28, 2022

We discussed it here:

#195

It does nothing new concerning fourier_synthesis, except maybe giving a bit more flexibility for the generation.

The main idea is to group utilities such as computing rms heights and fractional derivatives for a self=affine model PSD in one place.

Since this involves a full parametriyation of the PSD, we thought about adding fourier_synthesis a method for convenience.

This is not yet ready for merging.

@pastewka
Copy link
Contributor

Okay. It would be good not to duplicate things that are in fourier_synthetis and/or have fourier_synthesis use this class.

Why does this need to be a class and is not a bunch of functions? (I.e. what is the state of the object?)

@sannant
Copy link
Collaborator Author

sannant commented Jul 28, 2022

this class calls fourier_synthesis. It is not duplicate

@sannant
Copy link
Collaborator Author

sannant commented Jul 28, 2022

The purpose of the class is actually to easily plot a self=affine model PSD to compare it to experimental 1D PSD and fit the parameters with the eyes. Once this is done we can generate a representative synthetic surface with Fourier Synthesis.

@sannant
Copy link
Collaborator Author

sannant commented Jul 28, 2022

Why does this need to be a class and is not a bunch of functions? (I.e. what is the state of the object?)

My thought was to provide some flexibility on how to parametrize the Self-affine PSD via init, for example whether to give C0, Cr or wavelengths vs. wavevectors.
Afterwards providing flexibility in the implementation via some properties (e.g. everything available via properties, and then up to the class whether wavelengths or wavevectors are stored privately).

Note that this is currently absolutely not implemented yet.

@sannant
Copy link
Collaborator Author

sannant commented Jul 28, 2022

Do you think this is bad code style ? Should I rather implement that via wrappers or in each function separately ?

@sannant
Copy link
Collaborator Author

sannant commented Jul 28, 2022

The state of the object should be set at init and then immutable.

@pastewka
Copy link
Contributor

Classes should only be used if absolutely necessary, i.e. if they actually abstract some data. This may be the case here, they abstract the PSD data. Note that we could then write functions that act on such as class, such as Persson's model. The class should ideally be able to represent discretized (i.e. the average of a DST) PSDs. (This could be a subclass. I.e. you define an interface and implement your analytic PSDs. At some point we add the discrete PSD.)

@pastewka
Copy link
Contributor

You should think about the interface first and implement that as an abstract class. Then derive your analytic PSD class from it.

@sannant
Copy link
Collaborator Author

sannant commented Jul 28, 2022

Makes sense, and then we would implement how to do the integrals over these discretized PSDs there.
These discretized PSDs would be the output of a Container object.

@sannant
Copy link
Collaborator Author

sannant commented Jul 28, 2022

You should think about the interface first and implement that as an abstract class. Then derive your analytic PSD class from it.

Makes sense. The Abstract class would actually encompass any statistical description of a roughness.

@pastewka
Copy link
Contributor

Exactly. The power_spectrum_1D pipeline function would then return such a PowerSpectrum class.

@sannant
Copy link
Collaborator Author

sannant commented Jul 28, 2022

Do you think it is Ok to call ContactMechanics in our SurfaceTopography tests ? (it is practical for the half derivative computation)
Otherwise I would check consistency inside contactmechanics.

Note actually that the computation of the full-contact elastic energy for finite-thickness or graded materials should be part of ContactMechanics, where we define the Greeen's functions.

@pastewka
Copy link
Contributor

Yes, I have no objections using ContactMechanics in the tests.

@sannant
Copy link
Collaborator Author

sannant commented Jul 28, 2022

Ok I will add it separately in the installation workflow, for the CI testing. Not in requirements.

@pastewka
Copy link
Contributor

Yes, please don't put it in the requirements.

@sannant
Copy link
Collaborator Author

sannant commented Jul 28, 2022

Just wonder what should actually be a pipeline function and what should be a method ...

@sannant
Copy link
Collaborator Author

sannant commented Mar 20, 2023

@pastewka I think I adressed all the comments

I suggest that we merge this first and do a release. This will allow to merge my pull request in ContactMechanics, and allow you to turn the scanning probe simulation into a pipeline.

I will implement the integration of the ACF in a new branch.

@sannant sannant requested a review from pastewka March 20, 2023 14:40
@sannant
Copy link
Collaborator Author

sannant commented Mar 20, 2023

@pastewka do you know why half the tests just get cancelled ?

Copy link
Contributor

@pastewka pastewka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments. There are still two missing docstrings left from my previous round of comments. Also, CI does not seem to pass.

SurfaceTopography/ChangeLog.md Outdated Show resolved Hide resolved
SurfaceTopography/ChangeLog.md Outdated Show resolved Hide resolved
@sannant
Copy link
Collaborator Author

sannant commented Mar 24, 2023

CI is out of my power. tests pass but other wrkflow just cancel arbitrarily.

@sannant
Copy link
Collaborator Author

sannant commented Mar 24, 2023

Can you give me a hint for the docstrings ?

@pastewka
Copy link
Contributor

Can you give me a hint for the docstrings ?

If you click on "files changes" you should see the remaining comments.

@pastewka
Copy link
Contributor

CI is out of my power. tests pass but other wrkflow just cancel arbitrarily.

You need to increase the timeout. Including your new tests, CI takes longer than 30 minutes.

@sannant sannant requested a review from pastewka March 24, 2023 16:54
@sannant
Copy link
Collaborator Author

sannant commented Mar 24, 2023

I adressed requested changes and I increased timeout

pastewka
pastewka previously approved these changes Mar 25, 2023
@pastewka pastewka merged commit 7fe11bd into master Mar 25, 2023
@pastewka pastewka deleted the feat/22_models_issue_195 branch March 25, 2023 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants