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

[ENH] PC algorithm with updated example using dowhy.gcm for the SCM module #30

Merged
merged 16 commits into from
Sep 24, 2022

Conversation

adam2392
Copy link
Collaborator

@adam2392 adam2392 commented Aug 26, 2022

Fixes #18
Closes: #10

Changes proposed in this pull request:

  • This supersedes [ENH] Add PC algorithm #18
  • This is a "big PR", but the example goes hand-in-hand w/ the algorithm implementation. In general, I think any PR with "algorithms" should require at least a corresponding example, if not corresponding example + in-depth tutorial

Before submitting

  • I've read and followed all steps in the Making a pull request
    section of the CONTRIBUTING docs.
  • I've updated or added any relevant docstrings following the syntax described in the
    Writing docstrings section of the CONTRIBUTING docs.
  • If this PR fixes a bug, I've added a test that will fail without my fix.
  • If this PR adds a new feature, I've added tests that sufficiently cover my new functionality.

After submitting

  • All GitHub Actions jobs for my pull request have passed.

dodiscover/context.py Outdated Show resolved Hide resolved
dodiscover/context.py Outdated Show resolved Hide resolved
dodiscover/metrics.py Outdated Show resolved Hide resolved
dodiscover/metrics.py Outdated Show resolved Hide resolved
robertness
robertness previously approved these changes Sep 6, 2022
Copy link
Collaborator

@robertness robertness left a comment

Choose a reason for hiding this comment

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

I'm okay with this so long as my requests are addressed.

Also, can you double check that you have tests in place that will protect this code against pending refactors to the context object?

@codecov-commenter
Copy link

codecov-commenter commented Sep 8, 2022

Codecov Report

Merging #30 (a8fba22) into main (5b7465b) will increase coverage by 10.71%.
The diff coverage is 81.11%.

@@             Coverage Diff             @@
##             main      #30       +/-   ##
===========================================
+ Coverage   68.04%   78.75%   +10.71%     
===========================================
  Files          13       14        +1     
  Lines         679      805      +126     
  Branches      126      157       +31     
===========================================
+ Hits          462      634      +172     
+ Misses        175      118       -57     
- Partials       42       53       +11     
Impacted Files Coverage Δ
dodiscover/ci/oracle.py 86.95% <ø> (ø)
dodiscover/_protocol.py 60.52% <64.28%> (-1.02%) ⬇️
dodiscover/constraint/pcalg.py 79.61% <79.61%> (ø)
dodiscover/context.py 82.14% <90.90%> (+14.75%) ⬆️
dodiscover/constraint/_classes.py 81.42% <100.00%> (+81.42%) ⬆️
dodiscover/constraint/skeleton.py 75.64% <100.00%> (+5.12%) ⬆️
dodiscover/constraint/utils.py 61.53% <100.00%> (+15.38%) ⬆️
dodiscover/typing.py 100.00% <100.00%> (ø)
... and 2 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@adam2392
Copy link
Collaborator Author

adam2392 commented Sep 8, 2022

Also, can you double check that you have tests in place that will protect this code against pending refactors to the context object?

The context object is only accessed through its class properties rn and then the instantiations are used in the unit tests. They are used in conjunction w/ the PC algo, so in principle changes to the context that break PC algo, will be detected by those tests.

I've addressed most of your comments, except #30 (comment). In addition, some misc. topics:

Signed-off-by: Adam Li <adam2392@gmail.com>
Signed-off-by: Adam Li <adam2392@gmail.com>
Signed-off-by: Adam Li <adam2392@gmail.com>
Signed-off-by: Adam Li <adam2392@gmail.com>
Signed-off-by: Adam Li <adam2392@gmail.com>
Signed-off-by: Adam Li <adam2392@gmail.com>
Signed-off-by: Adam Li <adam2392@gmail.com>
Signed-off-by: Adam Li <adam2392@gmail.com>
Signed-off-by: Adam Li <adam2392@gmail.com>
Signed-off-by: Adam Li <adam2392@gmail.com>
Signed-off-by: Adam Li <adam2392@gmail.com>
Signed-off-by: Adam Li <adam2392@gmail.com>
Signed-off-by: Adam Li <adam2392@gmail.com>
Signed-off-by: Adam Li <adam2392@gmail.com>
robertness
robertness previously approved these changes Sep 21, 2022
Copy link
Collaborator

@robertness robertness left a comment

Choose a reason for hiding this comment

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

I think we should get this merged if there are no further concerns

Signed-off-by: Adam Li <adam2392@gmail.com>
robertness
robertness previously approved these changes Sep 22, 2022
Copy link
Collaborator

@robertness robertness left a comment

Choose a reason for hiding this comment

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

I agree that we can address include/exclude edge issues elsewhere.

Signed-off-by: Adam Li <adam2392@gmail.com>
@adam2392
Copy link
Collaborator Author

I agree that we can address include/exclude edge issues elsewhere.

Sorry can you re-approve? Fixing the merge conflicts inside changelog and conf.py and it disables your previous approval :(

Copy link
Collaborator

@robertness robertness left a comment

Choose a reason for hiding this comment

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

Reapproving

@adam2392 adam2392 merged commit 44ee3cd into py-why:main Sep 24, 2022
@adam2392 adam2392 deleted the pc3 branch September 24, 2022 17:03
darthtrevino pushed a commit that referenced this pull request Sep 27, 2022
…odule (#30)

* Adding example demonstrating usage of PC algorithm on simulated SCM data
* Add PC algorithm basic implementation

Signed-off-by: Adam Li <adam2392@gmail.com>
Signed-off-by: Chris Trevino <darthtrevino@gmail.com>
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.

Implement PC algorithm following API
3 participants