-
Notifications
You must be signed in to change notification settings - Fork 7
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
Conversation
…ion of issues in the previous pull request
pyproject.toml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add usage of pystack
pytdml/convert_utils.py
Outdated
There was a problem hiding this comment.
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.
pytdml/type/basic_types.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we discussed before.
There was a problem hiding this comment.
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.
tests/test_tdml_io.py
Outdated
There was a problem hiding this comment.
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.
There was a problem hiding this 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__': |
There was a problem hiding this comment.
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()
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 @@ | |||
# ------------------------------------------------------------------------------ |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lovely! 👏
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)