Skip to content

Conversation

@iamsaswata
Copy link
Owner

Summary

Fixes incorrect parameter order in test_read() function.

Problem

The test was calling open_data() with wrong parameter order:

# WRONG:
a = imd.open_data((2018, 2018), 'rain', 'yearwise', cwd)

Function signature is:

open_data(var_type, start_yr, end_yr=None, fn_format=None, file_dir=None)

The test was passing a tuple as var_type and strings as years, which would cause the test to fail.

Solution

Corrected parameter order:

# CORRECT:
a = imd.open_data('rain', 2018, 2018, 'yearwise', cwd)

Changes

  • File: test/test.py
  • Line 8: Fixed parameter order in open_data() call
  • Also cleaned up spacing in assert statement

Corrected parameter order in test_read() function call to match
open_data() signature.

Before: open_data((2018, 2018), 'rain', 'yearwise', cwd)
After:  open_data('rain', 2018, 2018, 'yearwise', cwd)

Correct signature: open_data(var_type, start_yr, end_yr, fn_format, file_dir)

Also fixed spacing in assert statement for consistency.
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

Successfully merging this pull request may close these issues.

2 participants