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

Modification and testing of stack_converter functionality and resolution of issues in the previous pull request #22

Merged
merged 4 commits into from
Nov 23, 2024

Conversation

Relifest
Copy link
Collaborator

Firstly, the issues discussed in the previous pull request and workflow configuration were resolved.
Secondly, I checked the original function for converting the stack to tdml and chose to rewrite it. Extract this feature from the utils and place it in the io folder, just like the tdml_reader. I called the pystack library provided by STAC official to read files in stack format, and made changes according to the original idea to form stack_converter. Among them, the conversion of elements mainly refers to the json schema.(https://github.com/radiantearth/stac-spec/blob/master/collection-spec/json-schema/collection.json)

pyproject.toml Outdated
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add usage of pystack

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this feature from the utils. In the future, I will move the functions belonging to IO such as yaml_to_tdml to the IO folder, and each function will belong to a different file. I think this structure will be much clearer.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we discussed before.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because there are more examples in different formats, I choose to distinguish them.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add testing for two recently updated functions.

Copy link
Contributor

@photonbit photonbit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks really good!

I only added two comments to keep the documentation and the usage of yaml_to_tdml as a command line tool.

@@ -321,8 +321,3 @@ def main():
training_datasets = yaml_to_tdml(yaml_path)
if training_datasets:
write_to_json(training_datasets, json_path)


if __name__ == '__main__':
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the project top README.md yaml_to_eo_tdml is used from the command line, instead of removing these lines, it should be:

if __name__ == '__main__':
    main()

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I forgot the use case in README.md. Do you think it is necessary to add such code logic to all conversion tools, so that they can be used through the command line.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At least for the ones that are exposed through the README or that were designed to be used as command line tools. i.e. the ones that are managing command line options like it is done in this file

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added logic to enable this function to be used through the command line.

@@ -0,0 +1,120 @@
# ------------------------------------------------------------------------------
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As the location of convert_stac_to_tdml was moved, the reference in the README.md should be updated too: https://github.com/openrsgis/pytdml?tab=readme-ov-file#convert-other-eo-dataset-formats-to-trainingdml-ai-format

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I will update the README.md later.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have already updated REAME.md here.

Copy link
Contributor

@photonbit photonbit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lovely! 👏

@Relifest Relifest merged commit f01f98c into openrsgis:main Nov 23, 2024
1 check 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.

2 participants