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

Cleanup: Remove Property.from_string and to_string #280

Closed
tbennun opened this issue Jun 11, 2020 · 8 comments
Closed

Cleanup: Remove Property.from_string and to_string #280

tbennun opened this issue Jun 11, 2020 · 8 comments
Labels
core good first issue Good for newcomers

Comments

@tbennun
Copy link
Collaborator

tbennun commented Jun 11, 2020

It is redundant with to_json and from_json.

@tbennun tbennun added the core label Sep 29, 2020
@tbennun tbennun added the good first issue Good for newcomers label Dec 7, 2022
@HarshvMahawar
Copy link

I would like to take up this issue but as Im new here can you help me with the thinking process, thanks

@tbennun
Copy link
Collaborator Author

tbennun commented Mar 15, 2023

The Property class has methods called to_string and from_string. These are now redundant with the to and from json methods that already exist in the codebase. It should be possible to remove those methods, as well as set_property_from_string.

You just need to make sure that no existing system depends on it. If you have any questions, feel free to ask.

@HarshvMahawar
Copy link

HarshvMahawar commented Mar 17, 2023

after restructuring the file properties.py, Is there any particular test file to run to check the dependency of property.to_string or from_string or will have to just run the pytest tests/. Also, you being an expert open-source developer can you suggest any good tool fit for open-source development especially spcl org. thanks :)

@tbennun
Copy link
Collaborator Author

tbennun commented Mar 23, 2023

You should run the tests with pytest. After making a pull request, we will run the entire test suite as part of our continuous integration (CI).

We mostly use Visual Studio Code for development. There is also a nice DaCe plugin for it too.

@luca-patrignani
Copy link
Contributor

Hi, I'm new to the project and I started working on this issue. I am noticing that lots of code depends on from_string method. In particular dace.serialize.from_json depends on it and this function is used by from_json of most Property's subclasses.

@tbennun
Copy link
Collaborator Author

tbennun commented Jan 6, 2024

@luca-patrignani Thank you for starting to work on this!

Individual Property subclasses may define their own static methods to convert from a string to themselves. So keeping, say, CodeProperty.from_string is fine. What we want to see is removing from_string and to_string from the general Property API, which will not force users to write another deserialization method apart from JSON.

The usage in dace.serialize.from_json is not the same as the properties. It is checking for a method with that name on a known_dtype, so it is safe to keep or remove. I don't think this code is ever called: https://app.codecov.io/gh/spcl/dace/blob/master/dace%2Fserialize.py#L124

Also, as said in my previous comment, this change will also result in free functions such as set_property_from_string to be safely removed.

@NNhanptnk
Copy link

NNhanptnk commented Jan 22, 2024

Hello !

I want to join helping for this issue as well. Can I join ?
I am relatively new. Where would you recommend me reading before jumping right in ? Thank you !

@tbennun
Copy link
Collaborator Author

tbennun commented Jan 22, 2024

@NNhanptnk I recommend starting by reading the documentation. The links I give in the two above comments are good starting points.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants