Skip to content

Commit

Permalink
Linting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
brynpickering committed Aug 27, 2024
1 parent 937232e commit a50a5b1
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 13 deletions.
1 change: 1 addition & 0 deletions examples/2_2_reading_data_osm.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@
"outputs": [],
"source": [
"import importlib_resources\n",
"\n",
"from genet import read_osm"
]
},
Expand Down
1 change: 1 addition & 0 deletions examples/4_2_using_network_road_pricing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"from pathlib import Path\n",
"\n",
"import pandas as pd\n",
"\n",
"from genet import read_matsim\n",
"\n",
"path_to_matsim_network = \"example_data/pt2matsim_network\"\n",
Expand Down
1 change: 1 addition & 0 deletions examples/5_3_modifying_network_simplification.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
],
"source": [
"import importlib_resources\n",
"\n",
"from genet import read_osm\n",
"\n",
"n = read_osm(\n",
Expand Down
1 change: 1 addition & 0 deletions examples/5_4_modifying_network_addition.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
],
"source": [
"import importlib_resources\n",
"\n",
"from genet import read_osm\n",
"\n",
"_n_tiny = read_osm(\n",
Expand Down
7 changes: 4 additions & 3 deletions examples/6_2_validating_network_google_directions_api.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@
"import os\n",
"import random\n",
"\n",
"import genet\n",
"import matplotlib.pyplot as plt\n",
"from shapely.geometry import LineString\n",
"\n",
"import genet\n",
"from genet import google_directions, read_matsim\n",
"from genet.output.spatial import generate_geodataframes\n",
"from genet.utils.io import save_geodataframe\n",
"from shapely.geometry import LineString"
"from genet.utils.io import save_geodataframe"
]
},
{
Expand Down
20 changes: 10 additions & 10 deletions tests/test_java_dtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,43 @@


def test_mapping_java_array_to_python_type():
assert java_to_python_dtype("java.lang.Array") == list
assert isinstance(java_to_python_dtype("java.lang.Array"), list)


def test_mapping_java_bool_to_python_type():
assert java_to_python_dtype("java.lang.Boolean") == bool
assert isinstance(java_to_python_dtype("java.lang.Boolean"), bool)


def test_mapping_java_double_to_python_type():
assert java_to_python_dtype("java.lang.Double") == float
assert isinstance(java_to_python_dtype("java.lang.Double"), float)


def test_mapping_java_long_to_python_type():
assert java_to_python_dtype("java.lang.Long") == float
assert isinstance(java_to_python_dtype("java.lang.Long"), float)


def test_mapping_java_float_to_python_type():
assert java_to_python_dtype("java.lang.Float") == float
assert isinstance(java_to_python_dtype("java.lang.Float"), float)


def test_mapping_java_integer_to_python_type():
assert java_to_python_dtype("java.lang.Integer") == int
assert isinstance(java_to_python_dtype("java.lang.Integer"), int)


def test_mapping_java_byte_to_python_type():
assert java_to_python_dtype("java.lang.Byte") == int
assert isinstance(java_to_python_dtype("java.lang.Byte"), int)


def test_mapping_java_short_to_python_type():
assert java_to_python_dtype("java.lang.Short") == int
assert isinstance(java_to_python_dtype("java.lang.Short"), int)


def test_mapping_java_char_to_python_type():
assert java_to_python_dtype("java.lang.Char") == str
assert isinstance(java_to_python_dtype("java.lang.Char"), str)


def test_mapping_java_string_to_python_type():
assert java_to_python_dtype("java.lang.String") == str
assert isinstance(java_to_python_dtype("java.lang.String"), str)


def test_unknown_java_type_raises_exception():
Expand Down

0 comments on commit a50a5b1

Please sign in to comment.