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

Choose documentation and coding style #7

Open
EiffL opened this issue Mar 5, 2021 · 4 comments
Open

Choose documentation and coding style #7

EiffL opened this issue Mar 5, 2021 · 4 comments

Comments

@EiffL
Copy link
Member

EiffL commented Mar 5, 2021

Same issue as in CosmoStat/autometacal#7

We want to adopt Google/TF conventions

@EiffL
Copy link
Member Author

EiffL commented Sep 6, 2021

Hey @b-remy , since we are going to be writing more code for GalFlow, what do you think of various documentation styles and code formatting? Do you have preferences?

I personally suggest we follow the Google/TensorFlow code styling for python.

Here are some links to the documentation for this:

@b-remy
Copy link
Collaborator

b-remy commented Sep 6, 2021

Agreed, I'll update existing documentation to the TensorFlow code styling!

@b-remy
Copy link
Collaborator

b-remy commented Sep 7, 2021

From https://www.tensorflow.org/community/contribute/code_style:

Operations that take tensors as arguments should call convert_to_tensor to convert non-tensor inputs into tensors if they are using C++ operations. Note that the arguments are still described as a Tensor object of a specific dtype in the documentation.

Should I convert all my non-tensor inputs before applying tensor operations?

@EiffL
Copy link
Member Author

EiffL commented Sep 7, 2021

Not necessarily... If it's very likely the inputs are scalars you should be fine, but if there is a chance people may send in numpy arrays, you should convert

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

No branches or pull requests

2 participants