Skip to content

Conversation

@teubert
Copy link
Collaborator

@teubert teubert commented Sep 26, 2021

Problem: Some examples cannot be run alone as scripts because they're dependent on other examples. Since it's setup as a package imports have to be from .[file_name] import [thing] in order to support python -m examples.[file_name]. However, this breaks when you run a file by itself from within examples directory (e.g., press run in IDE). For that to work the command from [file_name] import [thing] is needed (without the period). Multiple users have had issues with this

Solution: remove the intra-package dependency by adding thrown_object to prog_models.models. Set it up to not be imported by default (not part of init.all), and update the examples to use this version instead of the version defined in examples.new_model

Closes #137

@teubert teubert requested a review from kjjarvis September 26, 2021 20:33
@teubert teubert added the documentation Improvements or additions to documentation label Sep 26, 2021
@teubert teubert linked an issue Sep 26, 2021 that may be closed by this pull request
Copy link
Contributor

@kjjarvis kjjarvis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change looks great - good adjustment to allow easy implementation for many users

@teubert teubert merged commit 54ebf37 into dev Sep 27, 2021
@teubert teubert deleted the bug/decouple_examples branch September 27, 2021 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make Examples runnable as scripts

2 participants