This package is well-written. The overall code style is "boring" (in a positive sense), meaning that there are not excessive/unnecessary abstractions/use of fancy features, and so on. I like that most variables have long and verbose names. In my opinion, this is exactly the style needed for a scientific code (which makes it more accessible to domain experts and students).
From a technical point of view, there are a few choices that are not fully idiomatic. Examples are:
mutable objects as defaults
very long lines
comparisons with booleans in if statements
use of lists when tuple or generators would be more optimal
explicit inheritance from object
list created by appending
dictionaries created with dict instead of {}
dictionaries iterated with .keys()
and more tiny details like this
(There are also a lot of non-significant white spaces.)
I bring this up only to point out that there are some small opportunities to write better and more efficient code. The reason some patterns are more idiomatic is because they are objectively better/faster (e.g., dict() is more expensive than {} because there's the overhead of a function call). There are tools and services that can identify some of the above issues. In addition to the various linters/static analysis tools, you could have a look at deepsource (most of the features are going to be an overkill, but you can learn a lot from it; it's free with an educational account).
Feel free to close this issue at any time without changing the code (but it would be nice to at least remove the non-significant whitespaces).
This package is well-written. The overall code style is "boring" (in a positive sense), meaning that there are not excessive/unnecessary abstractions/use of fancy features, and so on. I like that most variables have long and verbose names. In my opinion, this is exactly the style needed for a scientific code (which makes it more accessible to domain experts and students).
From a technical point of view, there are a few choices that are not fully idiomatic. Examples are:
object
dict
instead of{}
.keys()
(There are also a lot of non-significant white spaces.)
I bring this up only to point out that there are some small opportunities to write better and more efficient code. The reason some patterns are more idiomatic is because they are objectively better/faster (e.g.,
dict()
is more expensive than{}
because there's the overhead of a function call). There are tools and services that can identify some of the above issues. In addition to the various linters/static analysis tools, you could have a look at deepsource (most of the features are going to be an overkill, but you can learn a lot from it; it's free with an educational account).Feel free to close this issue at any time without changing the code (but it would be nice to at least remove the non-significant whitespaces).