Giter Club home page Giter Club logo

Comments (10)

JustineBrgn avatar JustineBrgn commented on May 24, 2024 2

Would it be possible to make a checklist of the steps to follow when starting a new python project (creating a new environment, new Github repository,... ) and how to organise it?
(Sorry the message is quite late)

from sdia-python.

louisfrm avatar louisfrm commented on May 24, 2024 1

Could we talk about git branches?

from sdia-python.

SnowHawkeye avatar SnowHawkeye commented on May 24, 2024

My question is about mistakes in git histories. Here is an example of a bad commit I made for our lab. It's meaningless and I would have liked to delete it. The only way i see is to rewrite the history with a rebase, which is very unsafe on the main branch. Is there a way to do it more safely, or to add a comment / tag to the commit ? How can we avoid mistakes like that in the first place?

from sdia-python.

aurelienO avatar aurelienO commented on May 24, 2024

In a few lessons, we have seen examples of Python lambda functions. Is it possible to see how to write it and some examples of use?

Some examples :

normalize = lambda vec: (vec-np.mean(vec))/np.std(vec)  
g = lambda x, y: .5*(C*x**2 + y**2)
G = lambda x, y: np.array([C*x, y])

from sdia-python.

guilgautier avatar guilgautier commented on May 24, 2024

@SnowHawkeye #1 (comment)

My question is about mistakes in git histories. [...] The only way i see is to rewrite the history [...]

Everyone makes mistakes, and it's part of one's history.
Regarding your git history, rewriting/cleaning your local, unbranched and unpushed history is totally fine, and sometimes even desired (rewording commit messages, squashing commits, adding missing files to your last commit, ...).
On the contrary, when commits are shared between branches or (worse) shared with collaborators, rewriting can make histories diverge, difficult to reconcile, and overall it may impact everyone's work, badly.

How can we avoid mistakes like that in the first place?

  • discipline and experience are key I guess
  • work in a separate branch to avoid potential "contamination" of the main branch
  • use git status, git diff commands before even thinking of git add/commit
  • use additional tools like, black, pytest, pydocstyle etc., to make sure everything is formatted, tested, etc.

When it comes to notebooks

  • avoid using notebooks and/or do not version control them (exclude them in the .gitignore file)
  • for example scikit-learn doesn't use notebooks, even for showcase (in fact notebooks are generated from .py files, but you won't find .ipynb files in the repo).

I can give a few more words and/or give a quick demo about this during the last session.

from sdia-python.

guilgautier avatar guilgautier commented on May 24, 2024

@aurelienO #1 (comment)

In a few lessons, we have seen examples of Python lambda functions.

Could you post some examples here ? See creating-and-highlighting-code-blocks to display them in your comments.

Is it possible to see how to write it and some examples of use?

I can give a quick demo of lambda functions during the last session.
For more in-depth explanations, you can have look at this Real Python's tutorial

from sdia-python.

aurianworld avatar aurianworld commented on May 24, 2024

Can we come back on how to create a test (which method do you use) before even writting the function/class method you want to test ?

from sdia-python.

toto-haricot avatar toto-haricot commented on May 24, 2024

Could we talk about the differences between modules, packages, and librairies ?

from sdia-python.

LoanSarazin avatar LoanSarazin commented on May 24, 2024

Could we talk about licenses ? Which one do we have to chose and how are they all different ?

from sdia-python.

guilgautier avatar guilgautier commented on May 24, 2024

Hi everyone,

Most of the topics listed here were discussed during the last session.
I'm closing the issue, but feel free to reopen it or raise a new issue if you need further explanation.

As a follow up of @JustineBrgn question #1 (comment), I've created a new issue #2.
We've already drafted the roadmap together on the black board, feel free to interact on #2, while I'm preparing the corresponding note to appear in the notes/ folder.

from sdia-python.

Related Issues (2)

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.