y0-causal-inference / y0

❓y0 (pronounced "why not?") is for causal inference in Python
https://y0.readthedocs.io
BSD 3-Clause "New" or "Revised" License
45 stars 10 forks source link

Complete the y0 chirho PR so that it passes lint, documentation and tests. #215

Closed djinnome closed 7 months ago

augeorge commented 8 months ago

@djinnome issue w/ passing tests still "ERROR: Could not install packages due to an OSError: [Errno 28] No space left on device" https://github.com/y0-causal-inference/y0/actions/runs/8289952231/job/22687237876

djinnome commented 8 months ago

@cthoyt do you have any idea what could be going on? It passes the unit tests, but fails when installing packages before running the notebook test.

augeorge commented 8 months ago

when I run tox on my macbook I get the following errors, which I think are related to not having R installed? @djinnome @cthoyt

py: install_package_deps> python -I -m pip install ananke-causal click coverage more-click more-itertools networkx pandas pgmpy pyparsing pytest rpy2 scikit-learn statsmodels sympytorch tabulate tqdm
Collecting ananke-causal
  Using cached ananke_causal-0.5.0-py3-none-any.whl.metadata (3.3 kB)
Collecting click
  Using cached click-8.1.7-py3-none-any.whl.metadata (3.0 kB)
Collecting coverage
  Using cached coverage-7.4.4-cp310-cp310-macosx_11_0_arm64.whl.metadata (8.2 kB)
Collecting more-click
  Using cached more_click-0.1.2-py3-none-any.whl.metadata (4.3 kB)
Collecting more-itertools
  Using cached more_itertools-10.2.0-py3-none-any.whl.metadata (34 kB)
Collecting networkx
  Using cached networkx-3.2.1-py3-none-any.whl.metadata (5.2 kB)
Collecting pandas
  Using cached pandas-2.2.1-cp310-cp310-macosx_11_0_arm64.whl.metadata (19 kB)
Collecting pgmpy
  Using cached pgmpy-0.1.25-py3-none-any.whl.metadata (6.4 kB)
Collecting pyparsing
  Using cached pyparsing-3.1.2-py3-none-any.whl.metadata (5.1 kB)
Collecting pytest
  Using cached pytest-8.1.1-py3-none-any.whl.metadata (7.6 kB)
Collecting rpy2
  Using cached rpy2-3.5.15.tar.gz (219 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error

  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Unable to determine R home: [Errno 2] No such file or directory: 'R'
      cffi mode is CFFI_MODE.ANY
      Looking for R home with: R RHOME
      Unable to determine R home: [Errno 2] No such file or directory: 'R'
      R home found: None
      Error: rpy2 in API mode cannot be built without R in the PATH or R_HOME defined. Correct this or force ABI mode-only by defining the environment variable RPY2_CFFI_MODE=ABI
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
py: exit 1 (3.41 seconds) /Users/geor228/Github/y0> python -I -m pip install ananke-causal click coverage more-click more-itertools networkx pandas pgmpy pyparsing pytest rpy2 scikit-learn statsmodels sympytorch tabulate tqdm pid=15376
py: FAIL ✖ in 3.42 seconds
doctests: install_package_deps> python -I -m pip install ananke-causal click coverage more-click more-itertools networkx pandas pgmpy pyparsing pytest rpy2 scikit-learn statsmodels sympytorch tabulate tqdm
Collecting ananke-causal
  Using cached ananke_causal-0.5.0-py3-none-any.whl.metadata (3.3 kB)
Collecting click
  Using cached click-8.1.7-py3-none-any.whl.metadata (3.0 kB)
Collecting coverage
  Using cached coverage-7.4.4-cp310-cp310-macosx_11_0_arm64.whl.metadata (8.2 kB)
Collecting more-click
  Using cached more_click-0.1.2-py3-none-any.whl.metadata (4.3 kB)
Collecting more-itertools
  Using cached more_itertools-10.2.0-py3-none-any.whl.metadata (34 kB)
Collecting networkx
  Using cached networkx-3.2.1-py3-none-any.whl.metadata (5.2 kB)
Collecting pandas
  Using cached pandas-2.2.1-cp310-cp310-macosx_11_0_arm64.whl.metadata (19 kB)
Collecting pgmpy
  Using cached pgmpy-0.1.25-py3-none-any.whl.metadata (6.4 kB)
Collecting pyparsing
  Using cached pyparsing-3.1.2-py3-none-any.whl.metadata (5.1 kB)
Collecting pytest
  Using cached pytest-8.1.1-py3-none-any.whl.metadata (7.6 kB)
Collecting rpy2
  Using cached rpy2-3.5.15.tar.gz (219 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error

  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Unable to determine R home: [Errno 2] No such file or directory: 'R'
      cffi mode is CFFI_MODE.ANY
      Looking for R home with: R RHOME
      Unable to determine R home: [Errno 2] No such file or directory: 'R'
      R home found: None
      Error: rpy2 in API mode cannot be built without R in the PATH or R_HOME defined. Correct this or force ABI mode-only by defining the environment variable RPY2_CFFI_MODE=ABI
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
doctests: exit 1 (3.15 seconds) /Users/geor228/Github/y0> python -I -m pip install ananke-causal click coverage more-click more-itertools networkx pandas pgmpy pyparsing pytest rpy2 scikit-learn statsmodels sympytorch tabulate tqdm pid=15384
  lint: OK (0.62=setup[0.04]+cmd[0.32,0.26] seconds)
  manifest: OK (5.45=setup[0.01]+cmd[5.44] seconds)
  pyroma: OK (0.34=setup[0.01]+cmd[0.33] seconds)
  flake8: OK (6.75=setup[0.02]+cmd[6.73] seconds)
  mypy: OK (0.53=setup[0.01]+cmd[0.51] seconds)
  doc8: OK (0.18=setup[0.01]+cmd[0.16] seconds)
  docs: OK (6.36=setup[4.97]+cmd[1.39] seconds)
  docstr-coverage: OK (0.39=setup[0.01]+cmd[0.38] seconds)
  py: FAIL code 1 (3.42 seconds)
  doctests: FAIL code 1 (3.16 seconds)
  evaluation failed :( (27.27 seconds)
djinnome commented 8 months ago

I thought we removed the rpy dependencies. Try installing R and seeing if that resolves. If not, then just remove the rpy dependency

augeorge commented 8 months ago

installing R fixed the issue on my local machine.

however, there's still a problem with the notebook tests on the CI (everything passes on my macbook).

see: https://github.com/y0-causal-inference/y0/actions/runs/8304036939/job/22729123861

cthoyt commented 8 months ago

I cleaned up the CI and fixed the issue with running out of memory with Treon. Now the errors in CI are all real.

cthoyt commented 7 months ago

@augeorge @djinnome I cleaned up the PR to not include unfinished chirho connector and merged so the sympy parts are now released to v0.2.9 on pypi