Git Product home page Git Product logo

Comments (2)

zstephens avatar zstephens commented on August 19, 2024

Thank you for the style notes. I had chosen tabs as a personal preference (in that I just found them more attractive to work with), but I’ll look for inconsistencies like the one you noticed.

I’ll make a pass at adding some readability/usability improvements as you noted as well.

Thanks!
Zach

On Oct 11, 2016, at 5:08 PM, Stephen J Bush <[email protected]mailto:[email protected]> wrote:

For the most part the code not too difficult to follow, but readability could be improved by limiting the line length to 80 columns and using better whitespace. I would recommend using a linter and following pep8 standards.

This is less an issue and more of a suggestion. Whether or not these recommendations are implemented is, of course, entirely up to you. Either way, thank you for taking the time to write this software!

For example, line 58 in probability.py:

current

return str(self.weights)+' '+str(self.values)+' '+self.method

better

return str(self.weights) + ' ' + str(self.values) + ' ' + self.method

best

return '{} {} {}'.format(self.weights, self.values, self.method)

another option

return ' '.join([self.weights, self.values, self.method])

Similarly, lines 22-24 in probability.py:

if len(self.values) != len(self.weights):
print '\nError: length and weights and values vectors must be the same.\n'
exit(1)

could be more pythonic by using exceptions:

if len(self.values) != len(self.weights):
msg = 'Length and weight vectors must be the same length'
raise ValueError(msg)

(also, take a look at the logging package instead of using print).

Finally, tabs. I personally prefer using spaces (pep8 also recommends spaces), but the decision is ultimately yours; however, please try to be consistent. For example, lines 98-101 in SequenceContainer.py are indented using tabs up to the normal indentation, but the arguments are aligned to the [ using spaces.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_zstephens_neat-2Dgenreads_issues_5&d=DQMCaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=iSEBNMfCHfS5bLIS7AqI6wkxgRNv8-2dMwRF43ddddU&m=7hMnCNquNqL7uAqM9oMVPCMD8Sc-8UHHKfP2D9rVgFA&s=SRF9LOZQ3wjhQSbqQ-P7OPNBVdyesJBvQXzFLhy66jg&e=, or mute the threadhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AIHT1VvcD2fRzGzA3qKmQi3lB1nRtuv-2Dks5qzAjvgaJpZM4KUKMY&d=DQMCaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=iSEBNMfCHfS5bLIS7AqI6wkxgRNv8-2dMwRF43ddddU&m=7hMnCNquNqL7uAqM9oMVPCMD8Sc-8UHHKfP2D9rVgFA&s=M-OpCe8UpBD2MkW9dkLlTrPi3bh1lULYze89GXqFOJU&e=.

from neat-genreads.

muppetjones avatar muppetjones commented on August 19, 2024

Again, super quick response! Thanks!

Also--I hope you weren't offended by the comments/suggestions. Just things I noticed tracking down the other bug. Meant to be helpful.

from neat-genreads.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.