DifferentiableUniverseInitiative / GalFlow

A TensorFlow reimplementation of GalSim
MIT License
10 stars 4 forks source link

Choose documentation and coding style #7

Open EiffL opened 3 years ago

EiffL commented 3 years ago

Same issue as in https://github.com/CosmoStat/autometacal/issues/7

We want to adopt Google/TF conventions

EiffL commented 3 years ago

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 commented 3 years ago

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

b-remy commented 3 years ago

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 commented 3 years ago

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