Skip to content
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

Poor example of file names and folder organization #1225

Closed
kekoziar opened this issue Aug 3, 2021 · 7 comments
Closed

Poor example of file names and folder organization #1225

kekoziar opened this issue Aug 3, 2021 · 7 comments

Comments

@kekoziar
Copy link

kekoziar commented Aug 3, 2021

I've always read the different folders north-pacific-gyre, creatures, molecules as different projects, and so they would have their own data folders. But, then there's the generically named data folder. A similar example is the creation of the thesis but not using the writing/thesis folder to move files into.

Can either the data files be originally a good model, or the lesson adapted to fix the file names/structure to model good file naming and organization practices?

@gcapes
Copy link
Contributor

gcapes commented Aug 4, 2021

I agree - this bugs me too.
Perhaps some of the currently unused files were used at some point in the history of this lesson. I would propose that we cull anything which isn't currently used, and have the shell-lesson-data better organised to start with.
Someone has already put forward a suggestion for better organisation

@cilwerner
Copy link

cilwerner commented Aug 9, 2021

I like that new organisation idea, and also to fix the naming practices. Another exercise, which has been eluded to could be the solution, but at the same time needing to keep it fairly short, MCQ style as an add on to the "Moving files and directories section" as "Nelle's pipeline: Organising Files Part 2", keeping in line with the story of the episode. Could it replace the "Organising Files and Directories" exercise starting in 03-create.md L815

Maybe something like this (suggest edits!);


Reorganising a folder structure

At present, Nelle's folder structure looks like this

data-shell/
├── creatures
├── data
             ├ elements
             ├ animal-counts
            └ pdb
├── molecules
├── north-pacific-gyre
            └ 2012-07-03
├── writing
             ├ data
             ├ thesis
            └ tools
                  └ old

Although there is no official right or wrong way to organise files, some are better than others, and Nelle is considering to reorganise her folder structure. Which of the following would be considered a good reorganisation of her file structure

  1. Move the contents of data-shell/data into data-shell/writing/data (ANS: No, because you have data corresponding to writing and your other subprojects and it can be very confusing what data belongs to which. Remember that you can have the same folder names in different parent folders)
data-shell/
├── creatures
├── molecules
├── north-pacific-gyre
            └ 2012-07-03
├── writing
             ├ data
                  ├ elements
                  ├ animal-counts
                 └ pdb
             ├ thesis
            └ tools
                  └ old
  1. Have a relevant data directory in most folders excluding writing (ANS: Yes, it is much clearer what data corresponds to which directory)
data-shell/
├── creatures
            └ data
                   └ animal-counts
├── molecules
            └ data
                    ├ elements
                   └ pdb
├── north-pacific-gyre
            └ 2012-07-03
├── writing
             ├ data
             ├ thesis
            └ tools
                  └ old
  1. (Structure mentioned here (ANS: Yes - explanations therein)

  2. Keep the file structure as is. There is no need to reorganise as it is perfectly clear where everything is (ANS: No, although it is a file structure that can work, it can be difficult to pinpoint what the dat corresponds to)


@gcapes
Copy link
Contributor

gcapes commented Sep 1, 2021

I think having the suggested exercise without actually moving the files is a bit unsatisfactory, but tidying up unorganised files is a huge potential stumbling block for learners if later material refers to a particular directory structure.
So I think it's best to just have a good structure to start with.

I'm going to start work on tidying the files up, and have a bit more of a re-write of the lesson to include #1112.

@gcapes
Copy link
Contributor

gcapes commented Sep 1, 2021

Before I sink too much time into this, I've come up with this file structure. It's a compromise between good practice and making the exercises needlessly difficult to follow (e.g. putting shell scripts in a different directory to Nelle's data files).

.
├── exercise-data
│   ├── animal-counts
│   │   └── animals.csv
│   ├── creatures
│   │   ├── basilisk.dat
│   │   ├── minotaur.dat
│   │   └── unicorn.dat
│   ├── numbers.txt
│   ├── proteins
│   │   ├── cubane.pdb
│   │   ├── ethane.pdb
│   │   ├── methane.pdb
│   │   ├── octane.pdb
│   │   ├── pentane.pdb
│   │   └── propane.pdb
│   └── writing
│       ├── haiku.txt
│       └── LittleWomen.txt
└── north-pacific-gyre
    └── 2012-07-03
        ├── goodiff.sh
        ├── goostats.sh
        ├── NENE01729A.txt
        ├── NENE01729B.txt
        ├── NENE01736A.txt
        ├── NENE01751A.txt
        ├── NENE01751B.txt
        ├── NENE01812A.txt
        ├── NENE01843A.txt
        ├── NENE01843B.txt
        ├── NENE01971Z.txt
        ├── NENE01978A.txt
        ├── NENE01978B.txt
        ├── NENE02018B.txt
        ├── NENE02040A.txt
        ├── NENE02040B.txt
        ├── NENE02040Z.txt
        ├── NENE02043A.txt
        └── NENE02043B.txt

Any glaring problems?

@deppen8
Copy link
Contributor

deppen8 commented Sep 2, 2021

I like the proposed structure a lot. The scripts inside the dated folder are a bit of an anti-pattern, but I agree that putting them in a scripts/ directory or something would be overkill. What about just having them up one level: north-pacific-gyre/goodif.sh, etc?

Have you tried playing through the lesson with it yet? I assume quite a bit needs to be edited.

@gcapes
Copy link
Contributor

gcapes commented Sep 2, 2021

Great! Thanks for the feedback. I've not worked through the lesson yet with this new structure - it's going to be a lot of work so I wanted to get feedback on a new structure before I start :)

The problem I envisage with moving the scripts into a different directory might be something of a nothing, but it would certainly be more typing in the script created later in the lesson, and hence another place for learners to fall behind.

Ok, after typing and deleting a long stream-of-consciousness reply, I have come up with the following, which should encourage better directory structure, reduce typing of complicated names, and avoid the anti-pattern:

north-pacific-gyre/
├── data
│   ├── NENE01729A.txt
│   ├── NENE01729B.txt
│   ├── NENE01736A.txt
│   ├── NENE01751A.txt
│   ├── NENE01751B.txt
│   ├── NENE01812A.txt
│   ├── NENE01843A.txt
│   ├── NENE01843B.txt
│   ├── NENE01971Z.txt
│   ├── NENE01978A.txt
│   ├── NENE01978B.txt
│   ├── NENE02018B.txt
│   ├── NENE02040A.txt
│   ├── NENE02040B.txt
│   ├── NENE02040Z.txt
│   ├── NENE02043A.txt
│   └── NENE02043B.txt
└── scripts
    ├── goodiff.sh
    └── goostats.sh

@deppen8
Copy link
Contributor

deppen8 commented Sep 2, 2021

That's probably what I would do if it were my project, so that's alright with me.

gcapes added a commit to gcapes/shell-novice that referenced this issue Sep 7, 2021
@gcapes gcapes mentioned this issue Sep 7, 2021
gcapes added a commit to gcapes/shell-novice that referenced this issue Sep 9, 2021
gcapes added a commit to gcapes/shell-novice that referenced this issue Sep 16, 2021
@gcapes gcapes closed this as completed in f404284 Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants