harmonica icon indicating copy to clipboard operation
harmonica copied to clipboard

add total gradient amplitude transformation

Open leomiquelutti opened this issue 1 year ago • 2 comments

Relevant issues/PRs:

This PR resolves #470. I [x] implemented the total gradient amplitude function in _transformations.py [x] created the tga.py example [x] added the section Total gradient amplitude (aka Analytic Signal) to transformations.rst [x] added total_gradient_amplitude_test test to test_transformations.py

Notes:

  • I had difficulty checking if the mathematical expression in the transformations.rst compiled correctly.
  • I also don't know if I commented the function properly since I added a mathematical expression to it.

leomiquelutti avatar Mar 14 '24 14:03 leomiquelutti

💖 Thank you for opening your first pull request in this repository! 💖

A few things to keep in mind:

No matter what, we are really grateful that you put in the effort to do this!

welcome[bot] avatar Mar 14 '24 14:03 welcome[bot]

Hum I just noticed that I removed the comments of derivative_northing_kernel in filters\_filters.py. Do I have to undo it or can you refuse only this part of the proposed change?

leomiquelutti avatar Mar 15 '24 14:03 leomiquelutti

Thanks for opening this PR @leomiquelutti. I assigned myself to review it. I also started running CI so we it can test and check the style of your PR. Feel free to push fixes if you see any of those failing.

santisoler avatar Mar 20 '24 16:03 santisoler

@santisoler I fixed the comments I accidentally removed + ran make format + check. It passed some tests that were falling before. Do I have to do something else?

leomiquelutti avatar Mar 22 '24 17:03 leomiquelutti

Actually, there are 4 tests failing:

  • test_derivative_northing_kernel[1]
  • test_derivative_northing_kernel[2]
  • test_derivative_northing_kernel[3]
  • test_laplace_fft

Those always failed for me.

leomiquelutti avatar Mar 22 '24 19:03 leomiquelutti

Actually, there are 4 tests failing:

* test_derivative_northing_kernel[1]

* test_derivative_northing_kernel[2]

* test_derivative_northing_kernel[3]

* test_laplace_fft

Those always failed for me.

Yes, those are failing because of the lines changed in derivative_northing_kernel. See one of my comments above.

santisoler avatar Mar 22 '24 19:03 santisoler

Your corrections and suggestions are all good. I am only confused whether I should resolve the conversations or not. And what else I should do, actually.

Great! I saw you already merged a few of those, awesome!

I don't think there's a correct etiquette for marking conversations as resolved. When I usually go through someone else's review on my code, I mark them as resolve as I apply the suggested changes without any particular comment. If I took another approach, disagree with the suggestion or ask for more clarification I leave them as unresolved. Basically I used the resolve/unresolved state as a reminder of what things need to be done before merging. But that's up to you.

So, for a PR to be merged, it needs to pass all checks in CI, along with an approved review from one of the developers or maintainers. In this case, I'm seeing some of the checks failing, and we still have those modified lines in derivative_northing_kernel that should be restored (otherwise the tests on that function will keep failing). I also marked a few conversations as unresolved, since I think they need to be addressed.

If you want, I can help you restore those lines in derivative_northing_kernel, no worries.

santisoler avatar Mar 22 '24 23:03 santisoler

I don't think there's a correct etiquette for marking conversations as resolved. When I usually go through someone else's review on my code, I mark them as resolve as I apply the suggested changes without any particular comment. If I took another approach, disagree with the suggestion or ask for more clarification I leave them as unresolved. Basically I used the resolve/unresolved state as a reminder of what things need to be done before merging. But that's up to you.

Thanks!

If you want, I can help you restore those lines in derivative_northing_kernel, no worries.

Now I think I got it @santisoler! The file no longer appears as changed (as it should not). If I cannot make this time, I'll leave it to you if you are willing to help me 😃

And I'll go and take a look at the unresolved comments to address them.

leomiquelutti avatar Mar 23 '24 12:03 leomiquelutti

So, for a PR to be merged, it needs to pass all checks in CI, along with an approved review from one of the developers or maintainers. In this case, I'm seeing some of the checks failing, and we still have those modified lines in derivative_northing_kernel that should be restored (otherwise the tests on that function will keep failing). I also marked a few conversations as unresolved, since I think they need to be addressed.

Do the checks in CI run automatically? Or could I run it before I commit a change? Or can I run it somehow?

leomiquelutti avatar Mar 23 '24 13:03 leomiquelutti

So, for a PR to be merged, it needs to pass all checks in CI, along with an approved review from one of the developers or maintainers. In this case, I'm seeing some of the checks failing, and we still have those modified lines in derivative_northing_kernel that should be restored (otherwise the tests on that function will keep failing). I also marked a few conversations as unresolved, since I think they need to be addressed.

Do the checks in CI run automatically? Or could I run it before I commit a change? Or can I run it somehow?

They usually run automatically after you push a change. But I think GitHub has strengthen their security and maybe because you're a new contributor I need to approve the run of CI manually. This is annoying... but after we merge this PR, you won't face this issue again.

santisoler avatar Mar 25 '24 20:03 santisoler

Indeed, we have the "Require approval for first-time contributors" active in the configuration of GitHub Actions. Here are some docs about it.

I thought that once I approve the first run, then every run will be approved. But apparently not, I need to go and manually approve every run.

santisoler avatar Mar 25 '24 20:03 santisoler

Hi @santisoler is there anything else I should do about this PR? :)

I am only waiting for this PR to be done to open a new one to implement the tilt (if you mantainers agree to it, of course).

leomiquelutti avatar Mar 28 '24 13:03 leomiquelutti

Hi @santisoler is there anything else I should do about this PR? :)

Hi @leomiquelutti! No, nothing on your side. I just need to merge it. I'll do it today after CI finishes (I just updated this branch with the latest changes in main).

I am only waiting for this PR to be done to open a new one to implement the tilt (if you mantainers agree to it, of course).

That would be great! Is there a reason why you were waiting for this one to be finished? In most cases you can work on several features in parallel (unless they need a particular bit of code that is being developed in another PR). There's no particular rush to have these two transformations, but I was just curious about this comment.

santisoler avatar Mar 28 '24 16:03 santisoler

🎉 Congrats on merging your first pull request and welcome to the team! 🎉

If you would like to be added as a author on the Zenodo archive of the next release, add your full name, affiliation, and ORCID (optional) to the AUTHORS.md file of this repository. Feel free to do this in a new pull request if needed.

We hope that this was a good experience for you. Let us know if there is any way that the contributing process could be improved.

welcome[bot] avatar Mar 28 '24 17:03 welcome[bot]

That would be great! Is there a reason why you were waiting for this one to be finished? In most cases you can work on several features in parallel (unless they need a particular bit of code that is being developed in another PR). There's no particular rush to have these two transformations, but I was just curious about this comment.

This was my first experience contributing to an open-source project, so I wanted to see that everything went well before starting a new task.

A question @santisoler: should I keep working in this same branch or create a new one?

leomiquelutti avatar Mar 28 '24 17:03 leomiquelutti

This was my first experience contributing to an open-source project, so I wanted to see that everything went well before starting a new task.

Right, that's a very good reason! Makes total sense.

A question @santisoler: should I keep working in this same branch or create a new one?

It's preferred if you create a new one. The process would be:

  1. Switch to main in your local repo.
  2. Pull changes from the main branch in fatiando/harmonica.
  3. Create a new branch where you'll start working on the new feature.
  4. Open the PR for merging that new branch into main.

We do this for every PR, specially when you're working on different things in parallel, you don't want to mix changes from different PRs in a same branch. For example, you can now create one branch for the tilt implementation, and another branch to add yourself tot he AUTHORS.md file 🙂 .

santisoler avatar Mar 28 '24 17:03 santisoler