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

__init__(): incompatible constructor arguments #24

Closed
DobleD17 opened this issue May 23, 2024 · 3 comments
Closed

__init__(): incompatible constructor arguments #24

DobleD17 opened this issue May 23, 2024 · 3 comments

Comments

@DobleD17
Copy link

DobleD17 commented May 23, 2024

Hello, I am doing an app which can choose a ROI area, get a SRTM DSM a priori and work with CARS in this ROI.

I get the following error


2024-05-23 14:20:56,277 :: INFO ::  The AbstractGeometry SharelocGeometry plugin will be used
2024-05-23 14:20:56,339 :: ERROR ::  CARS terminated with following error
Traceback (most recent call last):
File "/home/ddiaz/CARS-Integration/cars/cars/cars.py", line 158, in main_cli
used_pipeline = Pipeline(pipeline_name, config, config_json_dir)
File "/home/ddiaz/CARS-Integration/cars/cars/pipelines/pipeline.py", line 60, in __new__
return cls.create_pipeline(pipeline_name, cfg, config_json_dir)
File "/home/ddiaz/CARS-Integration/cars/cars/pipelines/pipeline.py", line 88, in create_pipeline
pipeline = pipeline_class(cfg, config_json_dir)
File "/home/ddiaz/CARS-Integration/cars/cars/pipelines/sensor_to_dense_dsm/sensor_to_dense_dsm_pipeline.py", line 147, in __init__
) = sensors_inputs.check_geometry_plugin(
File "/home/ddiaz/CARS-Integration/cars/cars/pipelines/sensor_to_dense_dsm/sensors_inputs.py", line 363, in check_geometry_plugin
geom_plugin_with_dem_and_geoid = generate_geometry_plugin_with_dem(
File "/home/ddiaz/CARS-Integration/cars/cars/pipelines/sensor_to_dense_dsm/sensors_inputs.py", line 450, in generate_geometry_plugin_with_dem
AbstractGeometry(  # pylint: disable=abstract-class-instantiated
File "/home/ddiaz/CARS-Integration/cars/cars/core/geometry/shareloc_geometry.py", line 105, in __init__
bindings_cpp.DTMIntersection(  # pylint: disable=I1101
TypeError: __init__(): incompatible constructor arguments. The following argument types are supported:
1. bindings_cpp.DTMIntersection()
2. bindings_cpp.DTMIntersection(arg0: int, arg1: numpy.ndarray[numpy.float64], arg2: int, arg3: int, arg4: tuple[float, float, float, float, float, float])

Invoked with: 4326, array([[21.2836707 , 22.28345481, 21.28323893, ..., 32.26251388,
33.26229799, 34.26208211],
[20.28352315, 21.28330729, 21.28309143, ..., 32.26236899,
33.26215313, 35.26193727],
[22.28337559, 21.28315976, 21.28294393, ..., 33.26222409,
35.26200826, 37.26179243],
...,
[19.269425  , 20.26921199, 22.26899897, ..., 39.24854985,
39.24833684, 39.24812382],
[19.26939611, 21.26918312, 22.26897013, ..., 39.24852338,
39.24831039, 39.2480974 ],
[20.26936722, 21.26915426, 21.26894129, ..., 39.24849691,
40.24828394, 40.24807098]]), 110.0, 101, (-58.600138888888885, 0.0002777777777777778, 0.0, -34.473749999999995, 0.0, -0.0002777777777777778)

With this config file:

{
  "inputs": {
    "sensors": {
      "0": {
        "image": "ext_dir/ext_000.tif",
        "geomodel": "ext_dir/ext_000.geom"
      },
      "1": {
        "image": "ext_dir/ext_001.tif",
        "geomodel": "ext_dir/ext_001.geom"
      }
    },
    "pairing": [
      [
        "0",
        "1"
      ]
    ],
    "initial_elevation": "/home/ddiaz/CARS-Integration/ext_dir/SRTM.tif",
    "roi": {
      "type": "FeatureCollection",
      "features": [
        {
          "type": "Feature",
          "properties": {},
          "geometry": {
            "coordinates": [
              [
                [ -58.589916, -34.494567 ],
                [ -58.589916, -34.48000 ],
                [ -58.581805, -34.48000 ],
                [ -58.581805, -34.494567 ],
                [ -58.589916, -34.494567 ]
              ]
              ],
              "type": "Polygon"
          }
        }
      ]
    }
  
  },
    "output": {
        "out_dir": "out"
    },
    "orchestrator": {
        "mode": "local_dask",
        "walltime": "12:00:00"
    },
    "pipeline": "sensors_to_dense_dsm"
}

The files that I am using are simply the ones from "Maxar WorldView example files" from the How To How to…[((https://cars.readthedocs.io/en/stable/howto.html#how-to))]

@dyoussef
Copy link
Member

Hello @DobleD17,

Thank you for reporting this bug.

Can you try removing the "initial_elevation" parameter from your configuration file and relaunch cars to see if you still get an error?

@DobleD17
Copy link
Author

Hello @dyoussef , thanks you for your response. Without initial_elevation" parameter worked fine. Also I uninstall CARS and reinstall with pip install cars, because my instalation was with pip install -e . with source files. With this changes I have no problem even with initial_elevation parameter. Thanks!

@jguinet
Copy link
Contributor

jguinet commented May 28, 2024

Hi, @DobleD17, good news if its works without "initial_elevation" Your crash is caused by a Shareloc bug, in following code 110.0 is of type float whereas shareloc binding should be of type int. A fix will be provided soon.

Invoked with: 4326, array([[21.2836707 , 22.28345481, 21.28323893, ..., 32.26251388,
33.26229799, 34.26208211],
[20.28352315, 21.28330729, 21.28309143, ..., 32.26236899,
33.26215313, 35.26193727],
[22.28337559, 21.28315976, 21.28294393, ..., 33.26222409,
35.26200826, 37.26179243],
...,
[19.269425  , 20.26921199, 22.26899897, ..., 39.24854985,
39.24833684, 39.24812382],
[19.26939611, 21.26918312, 22.26897013, ..., 39.24852338,
39.24831039, 39.2480974 ],
[20.26936722, 21.26915426, 21.26894129, ..., 39.24849691,
40.24828394, 40.24807098]]), 110.0, 101, (-58.600138888888885, 0.0002777777777777778, 0.0, -34.473749999999995, 0.0, -0.0002777777777777778)

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

No branches or pull requests

3 participants