edsl 0.1.29.dev1__tar.gz → 0.1.29.dev3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/PKG-INFO +1 -1
- edsl-0.1.29.dev3/edsl/__version__.py +1 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/agents/AgentList.py +20 -1
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/language_models/ModelList.py +2 -2
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/results/Results.py +6 -8
- edsl-0.1.29.dev3/edsl/study/ObjectEntry.py +173 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/study/ProofOfWork.py +5 -2
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/study/SnapShot.py +4 -8
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/study/Study.py +27 -14
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/study/__init__.py +2 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/pyproject.toml +21 -22
- edsl-0.1.29.dev1/edsl/__version__.py +0 -1
- edsl-0.1.29.dev1/edsl/study/ObjectEntry.py +0 -97
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/LICENSE +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/README.md +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/Base.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/BaseDiff.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/__init__.py +1 -1
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/agents/Agent.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/agents/Invigilator.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/agents/InvigilatorBase.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/agents/PromptConstructionMixin.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/agents/__init__.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/agents/descriptors.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/config.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/conjure/AgentConstructionMixin.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/conjure/Conjure.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/conjure/InputData.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/conjure/InputDataCSV.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/conjure/InputDataMixinQuestionStats.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/conjure/InputDataPyRead.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/conjure/InputDataSPSS.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/conjure/InputDataStata.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/conjure/QuestionOptionMixin.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/conjure/QuestionTypeMixin.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/conjure/RawQuestion.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/conjure/SurveyResponses.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/conjure/__init__.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/conjure/examples/placeholder.txt +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/conjure/naming_utilities.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/conjure/utilities.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/conversation/Conversation.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/conversation/car_buying.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/conversation/mug_negotiation.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/conversation/next_speaker_utilities.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/coop/__init__.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/coop/coop.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/coop/utils.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/data/Cache.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/data/CacheEntry.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/data/CacheHandler.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/data/SQLiteDict.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/data/__init__.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/data/orm.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/data_transfer_models.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/enums.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/exceptions/__init__.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/exceptions/agents.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/exceptions/configuration.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/exceptions/coop.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/exceptions/data.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/exceptions/general.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/exceptions/jobs.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/exceptions/language_models.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/exceptions/prompts.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/exceptions/questions.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/exceptions/results.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/exceptions/surveys.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/inference_services/AnthropicService.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/inference_services/DeepInfraService.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/inference_services/GoogleService.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/inference_services/InferenceServiceABC.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/inference_services/InferenceServicesCollection.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/inference_services/OpenAIService.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/inference_services/__init__.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/inference_services/models_available_cache.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/inference_services/rate_limits_cache.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/inference_services/registry.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/inference_services/write_available.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/jobs/Answers.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/jobs/Jobs.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/jobs/__init__.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/jobs/buckets/BucketCollection.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/jobs/buckets/ModelBuckets.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/jobs/buckets/TokenBucket.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/jobs/interviews/Interview.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/jobs/interviews/InterviewStatistic.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/jobs/interviews/InterviewStatisticsCollection.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/jobs/interviews/InterviewStatusDictionary.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/jobs/interviews/InterviewStatusLog.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/jobs/interviews/InterviewStatusMixin.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/jobs/interviews/InterviewTaskBuildingMixin.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/jobs/interviews/ReportErrors.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/jobs/interviews/interview_exception_tracking.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/jobs/interviews/interview_status_enum.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/jobs/interviews/retry_management.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/jobs/runners/JobsRunnerAsyncio.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/jobs/runners/JobsRunnerStatusData.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/jobs/runners/JobsRunnerStatusMixin.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/jobs/tasks/QuestionTaskCreator.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/jobs/tasks/TaskCreators.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/jobs/tasks/TaskHistory.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/jobs/tasks/TaskStatusLog.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/jobs/tasks/task_management.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/jobs/tasks/task_status_enum.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/jobs/tokens/InterviewTokenUsage.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/jobs/tokens/TokenUsage.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/language_models/LanguageModel.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/language_models/RegisterLanguageModelsMeta.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/language_models/__init__.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/language_models/registry.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/language_models/repair.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/language_models/unused/ReplicateBase.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/notebooks/Notebook.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/notebooks/__init__.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/prompts/Prompt.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/prompts/QuestionInstructionsBase.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/prompts/__init__.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/prompts/library/agent_instructions.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/prompts/library/agent_persona.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/prompts/library/question_budget.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/prompts/library/question_checkbox.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/prompts/library/question_extract.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/prompts/library/question_freetext.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/prompts/library/question_linear_scale.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/prompts/library/question_list.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/prompts/library/question_multiple_choice.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/prompts/library/question_numerical.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/prompts/library/question_rank.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/prompts/prompt_config.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/prompts/registry.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/questions/AnswerValidatorMixin.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/questions/QuestionBase.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/questions/QuestionBudget.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/questions/QuestionCheckBox.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/questions/QuestionExtract.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/questions/QuestionFreeText.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/questions/QuestionFunctional.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/questions/QuestionList.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/questions/QuestionMultipleChoice.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/questions/QuestionNumerical.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/questions/QuestionRank.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/questions/RegisterQuestionsMeta.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/questions/SimpleAskMixin.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/questions/__init__.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/questions/compose_questions.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/questions/derived/QuestionLikertFive.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/questions/derived/QuestionLinearScale.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/questions/derived/QuestionTopK.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/questions/derived/QuestionYesNo.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/questions/derived/__init__.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/questions/descriptors.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/questions/question_registry.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/questions/settings.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/results/Dataset.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/results/Result.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/results/ResultsDBMixin.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/results/ResultsExportMixin.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/results/ResultsFetchMixin.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/results/ResultsGGMixin.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/results/ResultsToolsMixin.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/results/__init__.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/scenarios/Scenario.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/scenarios/ScenarioHtmlMixin.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/scenarios/ScenarioImageMixin.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/scenarios/ScenarioList.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/scenarios/ScenarioListPdfMixin.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/scenarios/__init__.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/shared.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/surveys/DAG.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/surveys/Memory.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/surveys/MemoryPlan.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/surveys/Rule.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/surveys/RuleCollection.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/surveys/Survey.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/surveys/SurveyCSS.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/surveys/SurveyExportMixin.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/surveys/SurveyFlowVisualizationMixin.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/surveys/__init__.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/surveys/base.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/surveys/descriptors.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/tools/__init__.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/tools/clusters.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/tools/embeddings.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/tools/embeddings_plotting.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/tools/plotting.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/tools/summarize.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/utilities/SystemInfo.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/utilities/__init__.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/utilities/ast_utilities.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/utilities/data/Registry.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/utilities/data/__init__.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/utilities/data/scooter_results.json +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/utilities/decorators.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/utilities/gcp_bucket/__init__.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/utilities/gcp_bucket/cloud_storage.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/utilities/gcp_bucket/simple_example.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/utilities/interface.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/utilities/repair_functions.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/utilities/restricted_python.py +0 -0
- {edsl-0.1.29.dev1 → edsl-0.1.29.dev3}/edsl/utilities/utilities.py +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = "0.1.29.dev3"
|
@@ -12,7 +12,7 @@ Example usage:
|
|
12
12
|
|
13
13
|
from __future__ import annotations
|
14
14
|
from collections import UserList
|
15
|
-
from typing import Optional, Union, Sequence
|
15
|
+
from typing import Optional, Union, Sequence, List, Any
|
16
16
|
from rich import print_json
|
17
17
|
from rich.table import Table
|
18
18
|
import json
|
@@ -241,6 +241,25 @@ class AgentList(UserList, Base):
|
|
241
241
|
|
242
242
|
"""
|
243
243
|
return cls([Agent.example(), Agent.example()])
|
244
|
+
|
245
|
+
@classmethod
|
246
|
+
def from_list(self, trait_name:str, values: List[Any]):
|
247
|
+
"""Create an AgentList from a list of values.
|
248
|
+
|
249
|
+
:param trait_name: The name of the trait.
|
250
|
+
:param values: A list of values.
|
251
|
+
"""
|
252
|
+
return AgentList([Agent({trait_name: value}) for value in values])
|
253
|
+
|
254
|
+
def __mul__(self, other: AgentList) -> AgentList:
|
255
|
+
"""Takes the cross product of two AgentLists."""
|
256
|
+
from itertools import product
|
257
|
+
|
258
|
+
new_sl = []
|
259
|
+
for s1, s2 in list(product(self, other)):
|
260
|
+
new_sl.append(s1 + s2)
|
261
|
+
return AgentList(new_sl)
|
262
|
+
|
244
263
|
|
245
264
|
def code(self, string=True) -> Union[str, list[str]]:
|
246
265
|
"""Return code to construct an AgentList.
|
@@ -56,11 +56,11 @@ class ModelList(Base, UserList):
|
|
56
56
|
return {"models": [model._to_dict() for model in self]}
|
57
57
|
|
58
58
|
@classmethod
|
59
|
-
def from_names(self, *args):
|
59
|
+
def from_names(self, *args, **kwargs):
|
60
60
|
"""A a model list from a list of names"""
|
61
61
|
if len(args) == 1 and isinstance(args[0], list):
|
62
62
|
args = args[0]
|
63
|
-
return ModelList([Model(model_name) for model_name in args])
|
63
|
+
return ModelList([Model(model_name, **kwargs) for model_name in args])
|
64
64
|
|
65
65
|
@add_edsl_version
|
66
66
|
def to_dict(self):
|
@@ -165,13 +165,7 @@ class Results(UserList, Mixins, Base):
|
|
165
165
|
)
|
166
166
|
|
167
167
|
def __repr__(self) -> str:
|
168
|
-
|
169
|
-
return f"""Results object
|
170
|
-
Size: {len(self.data)}.
|
171
|
-
Survey questions: {[q.question_name for q in self.survey.questions]}.
|
172
|
-
Created columns: {self.created_columns}
|
173
|
-
Hash: {hash(self)}
|
174
|
-
"""
|
168
|
+
return f"Results(data = {self.data}, survey = {repr(self.survey)}, created_columns = {self.created_columns})"
|
175
169
|
|
176
170
|
def _repr_html_(self) -> str:
|
177
171
|
json_str = json.dumps(self.to_dict()["data"], indent=4)
|
@@ -759,7 +753,10 @@ class Results(UserList, Mixins, Base):
|
|
759
753
|
|
760
754
|
def sort_by(self, *columns: str, reverse: bool = False) -> Results:
|
761
755
|
import warnings
|
762
|
-
|
756
|
+
|
757
|
+
warnings.warn(
|
758
|
+
"sort_by is deprecated. Use order_by instead.", DeprecationWarning
|
759
|
+
)
|
763
760
|
return self.order_by(*columns, reverse=reverse)
|
764
761
|
|
765
762
|
def order_by(self, *columns: str, reverse: bool = False) -> Results:
|
@@ -800,6 +797,7 @@ class Results(UserList, Mixins, Base):
|
|
800
797
|
│ Great │
|
801
798
|
└──────────────┘
|
802
799
|
"""
|
800
|
+
|
803
801
|
def to_numeric_if_possible(v):
|
804
802
|
try:
|
805
803
|
return float(v)
|
@@ -0,0 +1,173 @@
|
|
1
|
+
import time
|
2
|
+
import webbrowser
|
3
|
+
from typing import Any, Dict, Optional, Type
|
4
|
+
from edsl import QuestionBase
|
5
|
+
from edsl.Base import RegisterSubclassesMeta
|
6
|
+
|
7
|
+
|
8
|
+
class ObjectEntry:
|
9
|
+
def __init__(
|
10
|
+
self,
|
11
|
+
variable_name: str,
|
12
|
+
object: Any,
|
13
|
+
description: str,
|
14
|
+
coop_info: Optional[Dict[str, Any]] = None,
|
15
|
+
created_at: Optional[float] = None,
|
16
|
+
edsl_class_name: Optional[str] = None,
|
17
|
+
):
|
18
|
+
"""
|
19
|
+
Initialize an ObjectEntry instance.
|
20
|
+
|
21
|
+
:param variable_name: The name of the variable.
|
22
|
+
:param object: The object being wrapped.
|
23
|
+
:param description: A description of the object.
|
24
|
+
:param coop_info: Optional Coop information dictionary.
|
25
|
+
:param created_at: Optional creation timestamp. Defaults to current time.
|
26
|
+
:param edsl_class_name: Optional EDSL class name. Defaults to object's class name.
|
27
|
+
"""
|
28
|
+
self.created_at = created_at or time.time()
|
29
|
+
self.variable_name = variable_name
|
30
|
+
self.object = object
|
31
|
+
self.edsl_class_name = edsl_class_name or object.__class__.__name__
|
32
|
+
self.description = description
|
33
|
+
self.coop_info = coop_info
|
34
|
+
|
35
|
+
@classmethod
|
36
|
+
def _get_class(cls, object_dict: Dict[str, Any]) -> Type:
|
37
|
+
"""
|
38
|
+
Get the class of an object from its dictionary representation.
|
39
|
+
|
40
|
+
:param object_dict: The dictionary representation of the object.
|
41
|
+
:return: The class of the object.
|
42
|
+
"""
|
43
|
+
class_name = object_dict["edsl_class_name"]
|
44
|
+
if class_name == "QuestionBase":
|
45
|
+
return QuestionBase
|
46
|
+
else:
|
47
|
+
return RegisterSubclassesMeta._registry[class_name]
|
48
|
+
|
49
|
+
def __repr__(self) -> str:
|
50
|
+
"""
|
51
|
+
Return a string representation of the ObjectEntry instance.
|
52
|
+
|
53
|
+
:return: A string representation of the ObjectEntry instance.
|
54
|
+
"""
|
55
|
+
return f"ObjectEntry(variable_name='{self.variable_name}', object={self.object!r}, description='{self.description}', coop_info={self.coop_info}, created_at={self.created_at}, edsl_class_name='{self.edsl_class_name}')"
|
56
|
+
|
57
|
+
def to_dict(self) -> Dict[str, Any]:
|
58
|
+
"""
|
59
|
+
Convert the ObjectEntry instance to a dictionary.
|
60
|
+
|
61
|
+
:return: A dictionary representation of the ObjectEntry instance.
|
62
|
+
"""
|
63
|
+
return {
|
64
|
+
"created_at": self.created_at,
|
65
|
+
"variable_name": self.variable_name,
|
66
|
+
"object": self.object.to_dict(),
|
67
|
+
"edsl_class_name": self.edsl_class_name,
|
68
|
+
"description": self.description,
|
69
|
+
"coop_info": self.coop_info,
|
70
|
+
}
|
71
|
+
|
72
|
+
@classmethod
|
73
|
+
def from_dict(cls, d: Dict[str, Any]) -> "ObjectEntry":
|
74
|
+
"""
|
75
|
+
Create an ObjectEntry instance from a dictionary.
|
76
|
+
|
77
|
+
:param d: The dictionary representation of the ObjectEntry instance.
|
78
|
+
:return: An ObjectEntry instance.
|
79
|
+
"""
|
80
|
+
d["object"] = cls._get_class(d["object"]).from_dict(d["object"])
|
81
|
+
return cls(**d)
|
82
|
+
|
83
|
+
@property
|
84
|
+
def hash(self) -> str:
|
85
|
+
"""
|
86
|
+
Compute the hash of the object.
|
87
|
+
|
88
|
+
:return: The hash of the object as a string.
|
89
|
+
"""
|
90
|
+
return str(hash(self.object))
|
91
|
+
|
92
|
+
def add_to_namespace(self) -> None:
|
93
|
+
"""
|
94
|
+
Add the object to the global namespace using its variable name.
|
95
|
+
"""
|
96
|
+
globals()[self.variable_name] = self.object
|
97
|
+
|
98
|
+
@property
|
99
|
+
def coop_info(self) -> Optional[Dict[str, Any]]:
|
100
|
+
"""
|
101
|
+
Get the Coop information for the object.
|
102
|
+
|
103
|
+
:return: The Coop information dictionary, if available.
|
104
|
+
"""
|
105
|
+
return self._coop_info
|
106
|
+
|
107
|
+
@coop_info.setter
|
108
|
+
def coop_info(self, coop_info: Optional[Dict[str, Any]]) -> None:
|
109
|
+
"""
|
110
|
+
Set the Coop information for the object.
|
111
|
+
|
112
|
+
:param coop_info: The Coop information dictionary.
|
113
|
+
"""
|
114
|
+
self._coop_info = coop_info
|
115
|
+
|
116
|
+
def view_on_coop(self) -> None:
|
117
|
+
"""
|
118
|
+
Open the object's Coop URL in a web browser.
|
119
|
+
"""
|
120
|
+
if self.coop_info is None:
|
121
|
+
print("Object not pushed to coop")
|
122
|
+
return
|
123
|
+
url = self.coop_info.get("url")
|
124
|
+
webbrowser.open(url)
|
125
|
+
|
126
|
+
def push(self, refresh: Optional[bool] = False) -> Dict[str, Any]:
|
127
|
+
"""
|
128
|
+
Push the object to the Coop.
|
129
|
+
|
130
|
+
:param refresh: Whether to refresh the Coop entry for the object.
|
131
|
+
:return: The Coop info dictionary.
|
132
|
+
"""
|
133
|
+
if self.coop_info is None or refresh:
|
134
|
+
self.coop_info = self.object.push(description=self.description)
|
135
|
+
print(
|
136
|
+
f"Object {self.variable_name} pushed to coop with info: {self._coop_info}"
|
137
|
+
)
|
138
|
+
else:
|
139
|
+
print(
|
140
|
+
f"Object {self.variable_name} already pushed to coop with info: {self._coop_info}"
|
141
|
+
)
|
142
|
+
|
143
|
+
def __eq__(self, other: "ObjectEntry") -> bool:
|
144
|
+
"""
|
145
|
+
Check if two ObjectEntry instances are equal.
|
146
|
+
|
147
|
+
:param other: The other ObjectEntry instance.
|
148
|
+
:return: True if the two instances are equal, False otherwise.
|
149
|
+
"""
|
150
|
+
# if the other item is not "ObjectEntry" type, return False
|
151
|
+
if not isinstance(other, ObjectEntry):
|
152
|
+
return False
|
153
|
+
|
154
|
+
return (
|
155
|
+
self.variable_name == other.variable_name
|
156
|
+
and self.object == other.object
|
157
|
+
and self.description == other.description
|
158
|
+
and self.coop_info == other.coop_info
|
159
|
+
and self.created_at == other.created_at
|
160
|
+
and self.edsl_class_name == other.edsl_class_name
|
161
|
+
)
|
162
|
+
|
163
|
+
|
164
|
+
if __name__ == "__main__":
|
165
|
+
from edsl import QuestionFreeText
|
166
|
+
from edsl.study import ObjectEntry
|
167
|
+
|
168
|
+
q = QuestionFreeText.example()
|
169
|
+
|
170
|
+
oe = ObjectEntry("q", q, "This is a question")
|
171
|
+
d = oe.to_dict()
|
172
|
+
new_oe = ObjectEntry.from_dict(d)
|
173
|
+
new_oe == oe
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import hashlib
|
2
2
|
import time
|
3
|
-
from typing import
|
3
|
+
from typing import Any, Dict, List, Optional
|
4
4
|
|
5
5
|
|
6
6
|
class ProofOfWork:
|
@@ -16,7 +16,10 @@ class ProofOfWork:
|
|
16
16
|
self.input_data = input_data
|
17
17
|
|
18
18
|
def to_dict(self) -> Dict[str, Any]:
|
19
|
-
return {
|
19
|
+
return {
|
20
|
+
"input_data": self.input_data,
|
21
|
+
"proof": self.proof,
|
22
|
+
}
|
20
23
|
|
21
24
|
@classmethod
|
22
25
|
def from_dict(cls, data: Dict[str, Any]) -> "ProofOfWork":
|
@@ -1,16 +1,11 @@
|
|
1
|
-
from typing import Generator
|
2
1
|
import inspect
|
2
|
+
from typing import Generator, List, Optional
|
3
3
|
|
4
4
|
|
5
5
|
class SnapShot:
|
6
|
-
def __init__(self, namespace, exclude=None):
|
6
|
+
def __init__(self, namespace, exclude: Optional[List] = None):
|
7
7
|
self.namespace = namespace
|
8
|
-
|
9
|
-
if exclude is None:
|
10
|
-
self.exclude = []
|
11
|
-
else:
|
12
|
-
self.exclude = exclude
|
13
|
-
|
8
|
+
self.exclude = exclude or []
|
14
9
|
self.edsl_objects = dict(self._get_edsl_objects(namespace=self.namespace))
|
15
10
|
self.edsl_classes = dict(self._get_edsl_classes(namespace=self.namespace))
|
16
11
|
|
@@ -63,6 +58,7 @@ class SnapShot:
|
|
63
58
|
from edsl.study.Study import Study
|
64
59
|
|
65
60
|
for name, value in namespace.items():
|
61
|
+
# TODO check this code logic (if there are other objects with to_dict method that are not from edsl)
|
66
62
|
if (
|
67
63
|
hasattr(value, "to_dict")
|
68
64
|
and not inspect.isclass(value)
|
@@ -1,23 +1,19 @@
|
|
1
|
-
import os
|
2
|
-
import platform
|
3
|
-
import socket
|
4
1
|
import copy
|
5
2
|
import inspect
|
6
3
|
import json
|
7
|
-
|
4
|
+
import os
|
5
|
+
import platform
|
6
|
+
import socket
|
8
7
|
from datetime import datetime
|
9
|
-
|
10
|
-
# from edsl.Base import Base
|
8
|
+
from typing import Dict, Optional, Union
|
11
9
|
from edsl import Cache, set_session_cache, unset_session_cache
|
12
10
|
from edsl.utilities.utilities import dict_hash
|
13
|
-
|
14
11
|
from edsl.study.ObjectEntry import ObjectEntry
|
15
12
|
from edsl.study.ProofOfWork import ProofOfWork
|
16
13
|
from edsl.study.SnapShot import SnapShot
|
14
|
+
from uuid import UUID
|
17
15
|
|
18
|
-
|
19
|
-
class _StudyFrameMarker:
|
20
|
-
pass
|
16
|
+
# from edsl.Base import Base
|
21
17
|
|
22
18
|
|
23
19
|
class Study:
|
@@ -58,7 +54,7 @@ class Study:
|
|
58
54
|
proof_of_work=None,
|
59
55
|
proof_of_work_difficulty: int = None,
|
60
56
|
namespace: Optional[dict] = None,
|
61
|
-
verbose=True,
|
57
|
+
verbose: Optional[bool] = True,
|
62
58
|
):
|
63
59
|
"""
|
64
60
|
:param name: The name of the study.
|
@@ -469,11 +465,28 @@ class Study:
|
|
469
465
|
|
470
466
|
def push(self, refresh=False) -> None:
|
471
467
|
"""Push the objects to coop."""
|
472
|
-
|
473
|
-
|
468
|
+
|
469
|
+
from edsl import Coop
|
470
|
+
|
471
|
+
coop = Coop()
|
472
|
+
coop.create(self, description=self.description)
|
473
|
+
|
474
|
+
@classmethod
|
475
|
+
def pull(cls, id_or_url: Union[str, UUID], exec_profile=None):
|
476
|
+
"""Pull the object from coop."""
|
477
|
+
from edsl.coop import Coop
|
478
|
+
|
479
|
+
if id_or_url.startswith("http"):
|
480
|
+
uuid_value = id_or_url.split("/")[-1]
|
481
|
+
else:
|
482
|
+
uuid_value = id_or_url
|
483
|
+
|
484
|
+
c = Coop()
|
485
|
+
|
486
|
+
return c._get_base(cls, uuid_value, exec_profile=exec_profile)
|
474
487
|
|
475
488
|
def __repr__(self):
|
476
|
-
return f"""Study(name = {self.name}, description = {self.description}, objects = {self.objects}, cache = {self.cache}, filename = "{self.filename}", coop = {self.coop}, use_study_cache = {self.use_study_cache}, overwrite_on_change = {self.overwrite_on_change})"""
|
489
|
+
return f"""Study(name = "{self.name}", description = "{self.description}", objects = {self.objects}, cache = {self.cache}, filename = "{self.filename}", coop = {self.coop}, use_study_cache = {self.use_study_cache}, overwrite_on_change = {self.overwrite_on_change})"""
|
477
490
|
|
478
491
|
|
479
492
|
if __name__ == "__main__":
|
@@ -1,18 +1,27 @@
|
|
1
1
|
[build-system]
|
2
2
|
build-backend = "poetry.core.masonry.api"
|
3
|
-
requires = ["poetry-core"]
|
3
|
+
requires = [ "poetry-core",]
|
4
4
|
|
5
5
|
[tool.poetry]
|
6
|
-
authors = ["Apostolos Filippas <apostolos@expectedparrot.com>", "John Horton <john@expectedparrot.com>", "Robin Horton <robin@expectedparrot.com>"]
|
7
|
-
classifiers = ["Topic :: Scientific/Engineering :: Artificial Intelligence", "Topic :: Software Development :: Libraries :: Application Frameworks", "Topic :: Software Development :: Libraries :: Python Modules"]
|
6
|
+
authors = [ "Apostolos Filippas <apostolos@expectedparrot.com>", "John Horton <john@expectedparrot.com>", "Robin Horton <robin@expectedparrot.com>",]
|
7
|
+
classifiers = [ "Topic :: Scientific/Engineering :: Artificial Intelligence", "Topic :: Software Development :: Libraries :: Application Frameworks", "Topic :: Software Development :: Libraries :: Python Modules",]
|
8
8
|
description = "Create and analyze LLM-based surveys"
|
9
9
|
documentation = "https://docs.expectedparrot.com"
|
10
10
|
homepage = "https://www.expectedparrot.com/"
|
11
|
-
keywords = ["LLM", "social science", "surveys", "user research"]
|
11
|
+
keywords = [ "LLM", "social science", "surveys", "user research",]
|
12
12
|
license = "MIT"
|
13
13
|
name = "edsl"
|
14
14
|
readme = "README.md"
|
15
|
-
version = "0.1.29.
|
15
|
+
version = "0.1.29.dev3"
|
16
|
+
[[tool.poetry.packages]]
|
17
|
+
include = "edsl"
|
18
|
+
|
19
|
+
[tool.tomlsort]
|
20
|
+
all = true
|
21
|
+
in_place = true
|
22
|
+
spaces_before_inline_comment = 2
|
23
|
+
spaces_indent_inline_array = 4
|
24
|
+
trailing_comma_inline_array = true
|
16
25
|
|
17
26
|
[tool.poetry.dependencies]
|
18
27
|
python = ">=3.9.1,<3.13"
|
@@ -38,10 +47,16 @@ pymupdf = "^1.24.4"
|
|
38
47
|
restrictedpython = "^7.1"
|
39
48
|
pyreadstat = "^1.2.7"
|
40
49
|
|
50
|
+
[tool.poetry.scripts]
|
51
|
+
postinstall = "scripts.postinstall:main"
|
52
|
+
|
41
53
|
[tool.poetry.dependencies.black]
|
42
|
-
extras = ["jupyter"]
|
54
|
+
extras = [ "jupyter",]
|
43
55
|
version = "^24.4.2"
|
44
56
|
|
57
|
+
[tool.tomlsort.overrides."tool.poetry.dependencies"]
|
58
|
+
table_keys = false
|
59
|
+
|
45
60
|
[tool.poetry.group.dev.dependencies]
|
46
61
|
coverage = "^7.3.3"
|
47
62
|
mypy = "^1.7.1"
|
@@ -64,19 +79,3 @@ sphinx-fontawesome = "^0.0.6"
|
|
64
79
|
sphinx-rtd-theme = "^2.0.0"
|
65
80
|
toml = "^0.10.2"
|
66
81
|
toml-sort = "^0.23.1"
|
67
|
-
|
68
|
-
[[tool.poetry.packages]]
|
69
|
-
include = "edsl"
|
70
|
-
|
71
|
-
[tool.poetry.scripts]
|
72
|
-
postinstall = "scripts.postinstall:main"
|
73
|
-
|
74
|
-
[tool.tomlsort]
|
75
|
-
all = true
|
76
|
-
in_place = true
|
77
|
-
spaces_before_inline_comment = 2
|
78
|
-
spaces_indent_inline_array = 4
|
79
|
-
trailing_comma_inline_array = true
|
80
|
-
|
81
|
-
[tool.tomlsort.overrides."tool.poetry.dependencies"]
|
82
|
-
table_keys = false
|
@@ -1 +0,0 @@
|
|
1
|
-
__version__ = "0.1.29.dev1"
|
@@ -1,97 +0,0 @@
|
|
1
|
-
import time
|
2
|
-
from typing import Optional, Dict, Any, Type
|
3
|
-
|
4
|
-
|
5
|
-
class ObjectEntry:
|
6
|
-
def __init__(
|
7
|
-
self,
|
8
|
-
variable_name: str,
|
9
|
-
object: Any,
|
10
|
-
description: str,
|
11
|
-
coop_info: Optional[Dict[str, Any]] = None,
|
12
|
-
created_at: Optional[float] = None,
|
13
|
-
edsl_class_name: Optional[str] = None,
|
14
|
-
):
|
15
|
-
self.created_at = created_at or time.time()
|
16
|
-
self.variable_name = variable_name
|
17
|
-
self.object = object
|
18
|
-
self.edsl_class_name = edsl_class_name or object.__class__.__name__
|
19
|
-
self.description = description
|
20
|
-
self.coop_info = coop_info
|
21
|
-
|
22
|
-
@classmethod
|
23
|
-
def _get_class(self, obj_dict: Dict[str, Any]) -> Type:
|
24
|
-
"Get the class of an object from its dictionary representation."
|
25
|
-
class_name = obj_dict["edsl_class_name"]
|
26
|
-
if class_name == "QuestionBase":
|
27
|
-
from edsl import QuestionBase
|
28
|
-
|
29
|
-
return QuestionBase
|
30
|
-
else:
|
31
|
-
from edsl.Base import RegisterSubclassesMeta
|
32
|
-
|
33
|
-
return RegisterSubclassesMeta._registry[class_name]
|
34
|
-
|
35
|
-
def __repr__(self) -> str:
|
36
|
-
return f"ObjectEntry(variable_name='{self.variable_name}', object={self.object!r}, description='{self.description}', coop_info={self.coop_info}, created_at={self.created_at}, edsl_class_name='{self.edsl_class_name}')"
|
37
|
-
|
38
|
-
def to_dict(self) -> Dict[str, Any]:
|
39
|
-
return {
|
40
|
-
"created_at": self.created_at,
|
41
|
-
"variable_name": self.variable_name,
|
42
|
-
"object": self.object.to_dict(),
|
43
|
-
"edsl_class_name": self.edsl_class_name,
|
44
|
-
"description": self.description,
|
45
|
-
"coop_info": self.coop_info,
|
46
|
-
}
|
47
|
-
|
48
|
-
@classmethod
|
49
|
-
def from_dict(cls, d: Dict[str, Any]) -> "ObjectEntry":
|
50
|
-
d["object"] = cls._get_class(d["object"]).from_dict(d["object"])
|
51
|
-
return cls(**d)
|
52
|
-
|
53
|
-
@property
|
54
|
-
def hash(self) -> str:
|
55
|
-
return str(hash(self.object))
|
56
|
-
|
57
|
-
def add_to_namespace(self) -> None:
|
58
|
-
globals()[self.variable_name] = self.object
|
59
|
-
|
60
|
-
@property
|
61
|
-
def coop_info(self) -> Optional[Dict[str, Any]]:
|
62
|
-
return self._coop_info
|
63
|
-
|
64
|
-
@coop_info.setter
|
65
|
-
def coop_info(self, coop_info: Optional[Dict[str, Any]]) -> None:
|
66
|
-
self._coop_info = coop_info
|
67
|
-
|
68
|
-
def view_on_coop(self) -> None:
|
69
|
-
if self.coop_info is None:
|
70
|
-
print("Object not pushed to coop")
|
71
|
-
return
|
72
|
-
url = self.coop_info["url"]
|
73
|
-
import webbrowser
|
74
|
-
|
75
|
-
webbrowser.open(url)
|
76
|
-
|
77
|
-
def push(self, refresh: bool = False) -> Dict[str, Any]:
|
78
|
-
if self.coop_info is None or refresh:
|
79
|
-
self.coop_info = self.object.push(description=self.description)
|
80
|
-
print(
|
81
|
-
f"Object {self.variable_name} pushed to coop with info: {self._coop_info}"
|
82
|
-
)
|
83
|
-
else:
|
84
|
-
print(
|
85
|
-
f"Object {self.variable_name} already pushed to coop with info: {self._coop_info}"
|
86
|
-
)
|
87
|
-
|
88
|
-
|
89
|
-
if __name__ == "__main__":
|
90
|
-
from edsl import QuestionFreeText
|
91
|
-
|
92
|
-
q = QuestionFreeText.example()
|
93
|
-
|
94
|
-
oe = ObjectEntry("q", q, "This is a question")
|
95
|
-
d = oe.to_dict()
|
96
|
-
new_oe = ObjectEntry.from_dict(d)
|
97
|
-
# print(oe.coop_info)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -37,6 +37,6 @@ from edsl.shared import shared_globals
|
|
37
37
|
from edsl.jobs import Jobs
|
38
38
|
from edsl.notebooks import Notebook
|
39
39
|
from edsl.study.Study import Study
|
40
|
-
from edsl.coop.coop import Coop
|
41
40
|
from edsl.conjure.Conjure import Conjure
|
42
41
|
from edsl.language_models.ModelList import ModelList
|
42
|
+
from edsl.coop.coop import Coop
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|