-
Notifications
You must be signed in to change notification settings - Fork 31
Update README.md #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Update README.md #18
Conversation
|
Looks good. My pointers as you embark on this is:
|
Commiting first copy of pycharm (.py) python code file that I have been working on during the past month to read EEG files and begin preliminary exploration.
…ng with date and time information, to compare with values from biometric insturments such as EEG and GSR. Also some initial coding in the main python file for reading and visualizing this information.
…pearson r for variables that would like to explore in Mood_Focus_Table from Excel
…me feedback on related to how to graph the input from a specific sensor. I am also adding the EEG file that is being analysed
…ich can do pearson correlation analysis on two columns of data such as mood and alpha amplitude, and also adding the append_table_function which can append this same overarching spreadsheet of subjective and biometric data from new records, updating it with new relevant entries/recordings.
… more concise and clear comments to guide reader through each function
… good readability by user
q Merge branch 'master' of https://github.com/barlehmann/EEG_GSR_Wellness_Tracker i 'bad files' q
|
Dr. Lee, thank you for your response, this was certainly helpful to get my tests to run. However, after merging your changes, I began getting the following (below) error message after running pytest, suggesting that pytest is not connecting the graph module with the test_graph in the tests folder. I will continue to research this problem but wanted to keep you posted. ImportError while importing test module '/Users/barlehmann/Desktop/Python_project/github_project/EEG_GSR_Wellness_Tracker/tests/test_graph.py'. |
|
correct. The correct pattern when importing from the installed package is: The way you were importing only works if you are importing files from the directory your code is running in (not convenient/robust). |
|
Apologies. There was a init.py missing from that pull request. You need to include that in the directory eeg_gsr_wellness_tracker |
|
Dr. Lee, thanks for the information and suggestions. My tests presently both have the format you reccomended ( i.e from eeg_gsr_wellness_tracker import graph ) and I also added and empty init file to the directory you specified, however I am still getting the same error message. |
|
Thanks for the feedback. You are going about these problems in the correct way. I wouldn't be worried about what you have to show at the moment. You have demonstrated hard work and have met most of the rubric. Engaging with testing and working out some of the sordid details (which we can of course help you with) is an immensely valuable lesson to work through. Some details to help you pass your tests both locally and on circleci: you need to include pyopenxl and mne as dependencies for the project (install_requires argument to setup or use a requirements.txt file). When you install the code it gets relocated into the site-packages directory of your current python interpreter. This means that relative paths to data will both fail. Data should not be stored in the code directory and should never be referenced using an absolute path (they will fail for everyone but you on your current computer). If you do need data it for tests (which you likely will, and in this case do), put it in the tests directory. That way, the relative path makes sense in the context of the location of the test file. If testing the equality of two arrays the best thing to use is probably |
…have no problems accessing these files
fix paths to sample data used for tests remove some superfluous code add test to check that when sample data is read the first three values are as expected
data should not be hardcoded or stored in the code directory. These should be generic functions that operate on paths defined by the user of the code superfluous data is removed global variable was removed. a good heuristic is that if you are using a global variable you are doing something wrong removed additional keyword arguments to the io function from mne. You only specify keyword arguments if you want to. You don't have to specify a value for them if you do not want. do not use "pass". Not sure why it was included here
|
ok I have created a new pull request with a demonstration of a test that executes one of your functions and checks that the result is as expected. I have modified the function in the process. Your function was setting a global variable. It shouldn't do that. And append_table.py should not need data. That should be provided by the user. Please read through the code/comments/and commit messages and try to understand the logic of both the test and the function it tests as I have implemented it. |
Have a look at this example as well as the commit messages
|
Thank so much, that certainly helps me understand some of the issues I was having with there needing to be a data directory separate from the others, and that the global variables were causing some issues. I will certainly be looking into the logic of the test functions as you have implemented them. Much appreciated. |
|
Great. Glad to hear it helped. I only fixed one. I can help if you get stuck fixing the rest
… On May 5, 2020, at 18:41, barlehmann ***@***.***> wrote:
Thank so much, that certainly helps me understand some of the issues I was having with there needing to be a data directory separate from the others, and that the global variables were causing some issues. I will certainly be looking into the logic of the test functions as you have implemented them. Much appreciated.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
|
Impressive work. You really threw yourself at this. Well done. You have used of a wide range of advanced packages to achieve your goals and written it in a modular way that will make parts of it reusable for future sustainable expansion. For future improvement, look at some of the other projects for examples of testing. For example, this example of using pandas tools for testing when using data frames will be helpful to the sort of work you are doing. Sometimes the python style you use is odd, although often harmless from the perspective of execution of the program. I'm not sure where you picked them up. For example the syntax Or using multiline strings in the code as a mechanism to comment. Typically text editors will nicely wrap comments and prepend them with "#" so I just use that. Overall just keep an eye on pep8 as your python skills develop. Variable scoping was one issue that I think you should do a little reading about. Justified usage of global variables is exceptionally rare. You should typically only be using variables that you have imported from somewhere, defined in the scope of the current module, have recieved as input to a function, or defined within the current function's scope. Getting this right early on is important, otherwise you will adapt your coding in abnormal ways (like global variable usage) and suffer as a programmer in the long run. |



This is a pull request by Bar Lehmann