Skip to content

Commit

Permalink
fixing docs build (#211)
Browse files Browse the repository at this point in the history
* fixing docs build

* Fixing .readthedocs.yml

* add graphviz dep to rtd yml

* Update docs/requirements.txt

* Fixing rtd yaml

* trying with prereqs

* update setup.cfg test reqs

* Test imports

* tweak import test

* More debugging goggle installs

* don't ignore goggle

* testing pyreverse removal

* remove pyreverse

* Clean up

* Pydantic bugfix

* bugfix pydantic v2
  • Loading branch information
robsdavis authored Aug 8, 2023
1 parent 8831220 commit 859f2c1
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 11 deletions.
30 changes: 30 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.8"
apt_packages:
- graphviz

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

# Optionally build your docs in additional formats such as PDF
formats:
- pdf

python:
install:
- requirements: prereq.txt
- requirements: docs/requirements.txt
- method: pip
path: .
extra_requirements:
- all
12 changes: 6 additions & 6 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
"-f",
"-o",
"generated",
"-t", "_templates",
"-t",
"_templates",
"../src/synthcity/",
]
)


emojis = [
":rocket:",
":key:",
Expand All @@ -52,7 +52,7 @@
":rotating_light:",
]

#with open("../README.md", "rt") as fin:
# with open("../README.md", "rt") as fin:
# with open("README.md", "wt") as fout:
# for line in fin:
# for emoji in emojis:
Expand All @@ -73,9 +73,9 @@
"sphinxemoji.sphinxemoji",
"nbsphinx",
"sphinx_diagrams",
'IPython.sphinxext.ipython_console_highlighting',
'sphinx.ext.graphviz','sphinx.ext.inheritance_diagram',
"sphinx_pyreverse",
"IPython.sphinxext.ipython_console_highlighting",
"sphinx.ext.graphviz",
"sphinx.ext.inheritance_diagram",
]

autodoc_default_options = {
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ testing =
black
black-nb
darglint
docutils<0.18
doc8
flake8
isort
Expand Down
2 changes: 0 additions & 2 deletions src/synthcity/metrics/eval_statistical.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,6 @@ def _evaluate_stats(
X_gt: DataLoader,
X_syn: DataLoader,
) -> Tuple[Dict, Dict, Dict]:

stats_gt = {}
stats_syn = {}
stats_ = {}
Expand Down Expand Up @@ -711,7 +710,6 @@ def _evaluate(
X: DataLoader,
X_syn: DataLoader,
) -> Dict:

results = {}

X_ = X.numpy().reshape(len(X), -1)
Expand Down
2 changes: 1 addition & 1 deletion src/synthcity/plugins/core/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Schema(BaseModel):
"""

sampling_strategy: str = "marginal" # uniform or marginal
protected_cols = ["seq_id"]
protected_cols: List[str] = ["seq_id"]
random_state: int = 0
data: Any = None
domain: Dict = {}
Expand Down
8 changes: 6 additions & 2 deletions tests/plugins/core/test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@


def test_schema_fail() -> None:
with pytest.raises(pydantic.error_wrappers.ValidationError):
Schema(data="sdfsfs")
if pydantic.__version__ < "2":
with pytest.raises(pydantic.error_wrappers.ValidationError):
Schema(data="sdfsfs")
else:
with pytest.raises(pydantic.pydantic_core._pydantic_core.ValidationError):
Schema(data="sdfsfs")


def test_schema_ok() -> None:
Expand Down

0 comments on commit 859f2c1

Please sign in to comment.