seedcase-project / seedcase-sprout

Upload your research data to formally structure it for better, more reliable, and easier research.
https://sprout.seedcase-project.org/
MIT License
0 stars 0 forks source link

Avoid one-letter / very abbreviated variable names #509

Closed martonvago closed 3 weeks ago

martonvago commented 2 months ago

Another personal preference, but we could avoid having one-letter / very abbreviated variable names (even at the cost of being a bit more verbose). E.g. qp for query_params in helpers.py or c for col(umn).

lwjohnst86 commented 2 months ago

Yes! This is part of the style guide, https://design.seedcase-project.org/style/naming, so we should update things.

K-Beicher commented 1 month ago

@lwjohnst86, @martonvago I'd be happy to look through and compile a list of these, are we talking about files in Sprout?

martonvago commented 1 month ago

Yeah, in Sprout :)

K-Beicher commented 1 month ago

As some of these variables are difficult to search for, I've included the file name and the number of the line where the first occurrence is. Where no extension is written assume that it is a .py file.

Abbreviations: c - step_column, 19 col - csv_validator, 40 df - step_column, 84; step_file_upload, 98; csv_reader, 31; csv_validator, 30; test_csv_reader, 48 df_str - csv_validator, 36 df_strings - csv_validator, 65 dtype - csv_validator, 58 e - csv_reader, 68 idx - step_columns, 29 pl - csv_reader, 7; csv_validation_error, 3; csv_validator, 5; test_csv_validator, 7 s - step_columns, 88

In some instances the variable is referring to a plural entity, in which case we should probably keep it plural (eg. columns), but most of these should be checked to see if they should be singular.

DataTypes - data_types files - files, project_id_metadata_id_data_update, tabel_files forms - step_columns polars_types - data_types tables - columns, step_columns, step-columns.html, step_file_upload, tabel_files, db_test_utils, files tables_id - columns

@lwjohnst86, @martonvago - I've had a look through the files in Sprout and identified some of them. Some probably shouldn't change, I'll leave it to you to look at when you get back.