Giter Site home page Giter Site logo

pliffy's Introduction

Header

Hello and thank you for visiting my Github page!

My name is Martin Héroux and I am currently based in Sydney, Australia.

I have been coding for over 15 years and love to learn about computer science and the various concepts and practices that underpin clean code and maintainable software.

Scientist

I am a Research Fellow at Neuroscience Research Australia, where I work on a variety of exciting projects ranging from sensory illusions and muscle mechanics to motoneuron physiology, electrical stimulation to restore walking after spinal cord injury and various topics related to open and reproducible science.

You can find my scientific publications on ResearchGate and Google Scholar.

I maintain the scientificallysound blog with with my colleague and friend Dr. Joanna Diong. We discuss news and trends related to open and reproducible science and provide tutorials on statistics and coding.

Sample repositories related to my research:

ReadMe Card ReadMe Card

Python Developer

I am passionate about Python and its community. I have been using Python for all of my personal and professional projects for several years now.

I have blogged about Python on scientificallysound and was fortunate enough to be a guest on the TalkPython podcast.

I have published two packages on PyPi related to tools I have created as part of my research:

Header Header

Human

I enjoy exchanging ideas with like-minded individuals. Feel free to reach out and start a conversation.

github stats for Martin Martin Héroux Top Langs

pliffy's People

Contributors

joannadiong avatar martinheroux avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

joannadiong

pliffy's Issues

figure rendering in Readme.md

At present the pliffy logo and the example plot are not appearing on the rendered README.md on github, and this despite using the exact same format as I used for spike2py.

This might be because of the way I have to refer to the figures using the following call:

[![pliffy](https://raw.githubusercontent.com/MartinHeroux/pliffy/master/docs/source/img/pliffy_650x200.png)]

It might be that this source needs to be updated...not sure. I will check again tomorrow morning to see if my pictures are rendering properly. If not, will have to troubleshoot why this is not working.

Update and a few questions

Hi Bob,

Sorry for the lack of github action. I have been coding lots, but have not pushed stuff for a few reasons.

I had a working version of the plotting, including the elusive floating axis. It looked really cool and was pretty happy with myself. But I also realised I coded quickly, focused on determining whether what I wanted to do was actually possible. After getting the code to work, it was clear it was quite a mess, would not make sense to anyone else, and would be difficult to maintain.

So I have spent the last few nights refactoring the code. It has been difficult because making plots of this type is a lot of linear coding with if conditionals (e.g. if add_color == True: ...; if remove_axis == True: ...). When this is combined with some additional data processing, the codes gets long.

I have added a mixin class to help, and have also broken things down somewhat. However, I have come across a few issues I would like to get your thoughts on.


I read somewhere that is it not great coding practice to add attributes to a class outside the init method. Do you agree with this? What would be bad about such a practice?

I now have a Figure mixin class that is inherited by two other figure-related classes. The only method that is actually public in any of these class (public in the sense that a user might need to call them) in Figure .plot(). All the other methods break down the steps that need to go into making the figure. For examples, here is a method I flagged to discuss. The actual code needs work. the thing I want to highlight are the inputs and return value.

b

The method returns a value, but not to the user/caller. The method is called by another method of the same class. In theory, I could skip passing the inputs and returning of values if I simply assigned newly computed values that are required elsewhere to self.

In case that was not clear... I the above method I need to computer the optimal_yticks and use them to identify a few things and then also use them to actually set the y-ticks for the plot. By returning this value I now have to pass it around to all the method that want to use it. Would it not be simpler to make it into an attribute self.optimal_yticks = optimal_yticks?


I have another question about when to make something a method in a class vs a stand alone function (or maybe even a standalone smaller class). With Spike2py things were relatively clear. However, with this plotting stuff, everything could be done with a bunch of small functions located in separate modules, or they could be part of a class.

What I struggle with is that my original Figure class started to have way to many methods, some of which were not focused on generating the figure but rather computations to figure out where the floating axis had to be positioned.

It was handy to have the computation method in the Figure class because it could access all the attributes. But it was rather long and made for a confused class (it was definitely doing more than one thing).

I realise this hypothetical talk might be hard to grasp, and you would much rather look at the code and comment. I totally understand! I will try to get the code working again in the next day or two (my refactoring has currently left the code broken and I am mess as I struggle to find the best approach), and push it so that you can have a look.

[FEATURE]: Citation style

I'm trying to cite this (cool, and saves-me-so-much-work!) package, but am not used to citing software.
Do you have a preferred list of things for citation, and have I missed the DOI somewhere?
Thanks, Jo

[BUG] Import error

Describe the bug
Hi there. I followed the instructions on the Installation guide but received an error, reproduced below. Could you advise please?
Many thanks

To Reproduce
Steps to reproduce the behaviour:

>>> import pliffy
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/home/joanna/.local/share/JetBrains/Toolbox/apps/PyCharm-P/ch-0/202.6397.98/plugins/python/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "/home/joanna/Dropbox/Projects/anatomy/src/code/env/lib/python3.8/site-packages/pliffy/__init__.py", line 2, in <module>
    from . import plot
  File "/home/joanna/.local/share/JetBrains/Toolbox/apps/PyCharm-P/ch-0/202.6397.98/plugins/python/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "/home/joanna/Dropbox/Projects/anatomy/src/code/env/lib/python3.8/site-packages/pliffy/plot.py", line 1, in <module>
    from pliffy import estimate, parser, utils, figure
ImportError: cannot import name 'figure' from partially initialized module 'pliffy' (most likely due to a circular import) (/home/joanna/Dropbox/Projects/anatomy/src/code/env/lib/python3.8/site-packages/pliffy/__init__.py)

Python:
Python 3.8.5 (default, Sep 4 2020, 07:30:14)
[GCC 7.3.0] on linux

[BUG] PliffyInfoABD unexpected keyword argument 'figure_name'

Describe the bug
The how_to_guides.rst states to specify figure_name but utils.py line 134 requires plot_name. So running PliffyInfoABD following the docs instructions will generate the error above. I'd submit a pull request, but figure_name in text appears in a few places and I'm not sure which name is preferred. See what is best? Thanks.

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.