ioos / ioos_qc

:ballot_box_with_check: :ocean: IOOS QARTOD and other Quality Control tests implemented in Python
https://ioos.github.io/ioos_qc/
Apache License 2.0
46 stars 27 forks source link

Could not run some tests #69

Open Raynman67 opened 2 years ago

Raynman67 commented 2 years ago

Hi I've just switched to using the streams and stores, but now I seem to be having problems with my : climatology_test, flat_line_test, location_test

Could not run "qartod.climatology_test: climatology_test() missing 1 required positional argument: 'zinp'
Could not run "qartod.flat_line_test: int() argument must be a string, a bytes-like object or a number, not 'list'
Could not run "qartod.location_test: location_test() missing 2 required positional arguments: 'lon' and 'lat'

store

self.stream = PandasStream(self.data.ps)

results = self.stream.run( self.con

store = PandasStore(
            results,
            axes={
                't': self.data.ps[self.var_dict['time']],
                'z': self.data.ps[self.var_dict['water_depth']],
                'y': self.data.ps[self.var_dict['lat']],
                'x': self.data.ps[self.var_dict['lon']]
            }
        )

config :

contexts:
    -   window:
            starting: 1900-01-01T00:00:00Z
            ending: 2120-01-01T00:00:00Z
        streams:
            temperature:
                qartod:
                    gross_range_test:
                        suspect_span: [3, 4]
                        fail_span: [2, 5]
                    rate_of_change_test: 
                        threshold: [0.01]
                    spike_test:
                        suspect_threshold: [6]
                        fail_threshold: [18]
                    location_test:
                        bbox: [-66, 44,-63, 48 ]
                    flat_line_test:
                        tolerance: [1]
                        suspect_threshold: [2.5]
                        fail_threshold: [4]
                    climatology_test:
                        config:
                        -   vspan: [10, 13 ]
                            tspan: [ 1, 3 ]
                            period: month
                            zspan:  [ 0, 100 ]
                        -   vspan:  [ 11, 14 ]
                            tspan: [ 4,6 ]
                            period: month
                            zspan: [ 0, 100 ]
                        -   vspan:  [ 13,17 ]
                            tspan: [ 7, 9 ]
                            period: month
                            zspan:  [ 0 ,100 ]
                        -   vspan: [ 12, 16 ]
                            tspan: [ 10, 12 ]
                            period: month
                            zspan:  [ 0, 100 ]
Raynman67 commented 2 years ago

What is especially odd, is that the location_test runs fine against a NC file, but failes against an ERDDAP dataset

location_test Solved ? : renamed source data frame columns latitude/longitude to lat/lon

Raynman67 commented 2 years ago

Also, how to define the Region ?

Raynman67 commented 2 years ago

flatline test solved : It was exactly as stated, had paramters in config for flatline test as "lists"


flat_line_test:
                        tolerance: [1]
                        suspect_threshold: [2.5]
                        fail_threshold: [4]

vs

flat_line_test:
                        tolerance: 1
                        suspect_threshold: 2.5
                        fail_threshold: 4
Raynman67 commented 2 years ago

Accidently closed this. I still have issues with Climatology test and how to define region.

Thanks, Ray

Raynman67 commented 2 years ago

Climatology test Solved : renamed columns and dataframe.dropna() An example of region still needed