Skip to content

Conversation

@bhass-neon
Copy link
Collaborator

New functionality in AOP to check if files exist with logic explained below:

skip_if_exists
If skip_if_exists=True:

  • The function checks if each file already exists locally.
  • If a file does not exist locally, it is downloaded.
  • If a file exists and its checksum matches the latest version on the NEON Data Portal, it is skipped (not downloaded again).
  • If a file exists but its checksum does not match, the function will either prompt you, skip, or overwrite it—depending on the overwrite option (y/n/prompt)

If skip_if_exists=False:

  • The function does not check for existing files or their checksums.
  • All files are downloaded and will overwrite any existing files by default.

overwrite
This option only applies if skip_if_exists=True. This determines what happens when a file exists locally but its checksum does not match the latest published version on the NEON Data Portal

  • overwrite='yes': Overwrite mismatched files automatically (no prompt).
  • overwrite='no': Skip mismatched files (do not overwrite, no prompt).
  • overwrite='prompt' (default): Prompt the user to decide whether to overwrite each mismatched file.

Notes:

  • If skip_if_exists=False, the overwrite option is ignored and all files are overwritten, according to the default function behavior (assuming no pre-existing files in the expected folder). A warning message appears if skip_if_exists=False and overwrite='yes' or 'no'.
  • If there are additional files in the expected folder, a warning message will appear for by_file_aop only. For by_tile_aop, there may be a different # of folders depending on the easting, northing and buffer that are used.

@cklunch cklunch merged commit ad6067c into main Oct 22, 2025
3 checks passed
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.

3 participants