Giter Club home page Giter Club logo

ie_pandas's People

Contributors

ashomah avatar geraldwal avatar hofi45 avatar lhandal avatar

Watchers

 avatar  avatar

ie_pandas's Issues

Don't import modules inside classes

I noticed that you are importing numpy inside the class definition:

https://github.com/lhandal/ie_pandas/blob/73253267fbaa5eb74dea3b12c73c1020b8eee88a/src/ie_pandas/__init__.py#L1-L3

However, it doesn't work as you expect:

juanlu@centauri /tmp $ cat importing.py 
class Foo:
    import numpy as np
    def foo(self):
        return np.arange(4)
    def correct_foo(self):
        return self.np.arange(4)
juanlu@centauri /tmp $ python3 -q
>>> from importing import Foo
>>> f = Foo()
>>> f.foo()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/tmp/importing.py", line 4, in foo
    return np.arange(4)
NameError: name 'np' is not defined
>>> f.correct_foo()
array([0, 1, 2, 3])

You still don't have tests for DataFrame (#5) and that's why you probably didn't notice so far.

Testing correct print of DataFrame: problem with acceptance of expected_output

Dear @Juanlu001,

we have a recurring problem during the testing. We want to test our DataFrame class for converting different input types with different value types in it against an expected_output print of the dataframe.

As an example, one of the pytests we made for this is the following

from ie_pandas import DataFrame
import pytest

def test_string_input_in_list():
    artists_age_list = ["James Blake", "Björk", "Christine & The Queens", "DJ Koze", "Solange"]

    df1 = DataFrame(artists_age_list)

    expected_output =                        0\n0             James Blake\n1                   Björk\n2  Christine & The Queens\n3                 DJ Koze\n4                 Solange
    
    actual_output = df1

    assert actual_output == expected_output

The problem situates itself on the expected_output line. We get the following error running pytest:
Schermafbeelding 2019-05-01 om 02 12 34

Also when we put quotation marks around the output, an Assertion error is risen.
Schermafbeelding 2019-05-01 om 02 18 28

How can we overcome this and make our test successful?

Thanks in advance!

Use forks

It seems that you are all pushing branches to this repository, and that you are not using forks:

Screenshot_2019-04-26 lhandal ie_pandas

https://github.com/lhandal/ie_pandas/network/members

Even though some projects are carried out like this, I explicitly instructed you to work from forks:

"The library must be developed incrementally, using pull requests that should depart from a fork branch (i.e. not from master, not from a branch in the same repository)"

The reasons are mainly three:

  • It's how you have to work on projects were you don't have write permissions (i.e. contributing to open source)
  • Forces you to learn proper git workflow
  • Removes the temptation to have several people pushing to the same branch, which is a recipe for disaster

Please keep this in mind from now on

No part of contributors

Dear @Juanlu001 ,
I am a bit confused with why my commits are not counted in the contributors.

I think you previously commented on this, but I think I did not completely understand how to tackle this.

Thanks in advance for helping me out.
Schermafbeelding 2019-04-30 om 01 31 03

Add tests

You are adding a lot of functionality that is not tested. I recommend that you

  • Test what's already written
  • Don't merge pull requests that add functionality without tests

Otherwise, there's a risk you leave the tests for the very end, and believe me - you will find last-minute problems that will make your life more difficult.

skipping of tests

Dear @Juanlu001,
when doing pytest --cov=ie_pandas tests/OK in our latest version with all working tests, seven tests are passed correctly and everything seems to be fine. However, all tests we wrote regarding datatypes seem to be ignored. Here you see an example of a test to see if a dict_of_lists with floats can be correctly converted to a df.

from ie_pandas import DataFrame
import pytest

def float_input_in_dict_of_lists():
    artists_dict_of_lists = {'age':[30.0, 53.0, 31.0, 47.0, 32.0], 'albums':[4.0, 10.0, 2.0, 5.0, 4.0]}
    dict_of_lists_df = DataFrame(artists_dict_of_lists, rowindex = ['R1', 'R2', 'R3', 'R4', 'R5'], colindex=['age', 'albums'])

    expected_output = "age  albums/nR1  30.0       4.0/nR2  53.0      10.0/nR3  31.0       2.0/nR4  47.0       5.0/nR5  32.0       4.0"

    actual_output = DataFrame(dict_of_lists_df)

    assert actual_output == expected_output

Can you tell us what should be rewritten to make this test passing as well?

Thanks in advance!

Remove .DS_Store

Even though you properly defined a .gitignore file, some .DS_Store files ended up in the repository. You should remove them.

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.