Skip to content

Commit

Permalink
Merge pull request #13 from terasakisatoshi/introduce-ruff
Browse files Browse the repository at this point in the history
Introduce ruff
  • Loading branch information
terasakisatoshi authored Mar 4, 2024
2 parents 64ca94d + 5689676 commit 97045ea
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 13 deletions.
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12.0
2 changes: 1 addition & 1 deletion playground/pluto/mylib.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
def f(x):
return x ** 3
return x**3
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ dev-dependencies = [
"juliapkg>=0.1.10",
"ipython>=8.18.1",
"pytest>=7.4.3",
"ruff>=0.3.0",
]

[tool.hatch.metadata]
Expand Down
8 changes: 1 addition & 7 deletions requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ cycler==0.12.1
# via matplotlib
decorator==5.1.1
# via ipython
exceptiongroup==1.2.0
# via ipython
# via pytest
executing==2.0.1
# via stack-data
fonttools==4.49.0
Expand Down Expand Up @@ -89,21 +86,18 @@ python-dateutil==2.9.0.post0
# via pandas
pytz==2024.1
# via pandas
ruff==0.3.0
semantic-version==2.10.0
# via juliapkg
six==1.16.0
# via asttokens
# via python-dateutil
stack-data==0.6.3
# via ipython
tomli==2.0.1
# via black
# via pytest
traitlets==5.14.1
# via ipython
# via matplotlib-inline
typing-extensions==4.10.0
# via black
# via pydantic
# via pydantic-core
tzdata==2024.1
Expand Down
2 changes: 1 addition & 1 deletion src/python/jlrye/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@


def hello():
return "Hello from jldev-rye!"
return "Hello from jldev-rye!"
4 changes: 1 addition & 3 deletions src/python/jlrye/julia_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@

JLRye = jl.JLRye


def jl_generate_points() -> pd.DataFrame:
jldf = JLRye.generate_points()
pydf = juliacall.PythonCall.pytable(jldf)
return pydf



5 changes: 4 additions & 1 deletion test/python/jlrye/test_jlrye.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,18 @@ def test_Lorenz_attractor():
assert attractor.y == 1
assert attractor.z == 1


def test_py_generate_points():
df = generate_points()
assert df.shape == (1500, 3)


def test_jl_generate_points():
df = jl_generate_points()
assert df.shape == (1500, 3)


def test_generate_points():
ref = jl_generate_points()
tar = generate_points()
assert np.allclose(ref, tar)
assert np.allclose(ref, tar)

0 comments on commit 97045ea

Please # to comment.