Skip to content

Commit

Permalink
rename schema to variable
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgshaw committed May 23, 2023
1 parent aee5f3c commit f260e71
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ dmypy.json
# Pyre type checker
.pyre/


data
docker
results
Expand All @@ -138,4 +137,4 @@ nb_*
*.sh
.DS_Store
experiments
schemas
variables
2 changes: 1 addition & 1 deletion configure_atp.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
wave_output_dir = args.output_path / wave
wave_output_dir.mkdir(parents=True, exist_ok=True)

survey.generate_atp_schema(wave, wave_output_dir / "variables.json")
survey.generate_atp_variables(wave, wave_output_dir / "variables.json")

# This is a simple way to put some extra stuff in the variables file
if args.base_variables:
Expand Down
6 changes: 3 additions & 3 deletions lm_survey/survey/survey.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ def generate_variables_file(self, variables_filename: str):
# Export every time a variable is added to not accidentally lose progress.
self.export_variables(variables_filename=variables_filename)

def generate_atp_schema(self, survey_path: str, variables_filename: str):
def generate_atp_variables(self, survey_path: str, variables_filename: str):
info_csv_path = Path(survey_path) / "info.csv"

info_df = pd.read_csv(info_csv_path)
Expand Down Expand Up @@ -560,15 +560,15 @@ def __iter__(

data_dir = os.path.join("data", args.survey_name)
experiment_dir = os.path.join("experiments", args.survey_name, args.experiment_name)
schema_dir = os.path.join("schemas", args.survey_name)
variable_dir = os.path.join("variables", args.survey_name)

with open(os.path.join(experiment_dir, "config.json"), "r") as file:
config = json.load(file)

survey = Survey(
name="roper",
data_filename=os.path.join(data_dir, "data.csv"),
variables_filename=os.path.join(schema_dir, "schema.json"),
variables_filename=os.path.join(variable_dir, "variable.json"),
independent_variable_names=config["independent_variable_names"],
dependent_variable_names=config["dependent_variable_names"],
)
Expand Down
4 changes: 2 additions & 2 deletions run_survey.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ async def main(
n_samples_per_dependent_variable: typing.Optional[int] = None,
) -> None:
data_dir = os.path.join("data", survey_name)
schema_dir = os.path.join("schemas", survey_name)
variables_dir = os.path.join("variables", survey_name)
experiment_dir = os.path.join("experiments", experiment_name, survey_name)

with open(os.path.join(experiment_dir, "config.json"), "r") as file:
Expand All @@ -80,7 +80,7 @@ async def main(
survey = Survey(
name=survey_name,
data_filename=os.path.join(data_dir, "data.csv"),
variables_filename=os.path.join(schema_dir, "schema.json"),
variables_filename=os.path.join(variables_dir, "variables.json"),
independent_variable_names=config["independent_variable_names"],
dependent_variable_names=config["dependent_variable_names"],
)
Expand Down

0 comments on commit f260e71

Please sign in to comment.