-
Notifications
You must be signed in to change notification settings - Fork 7
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
🧪Project API Tryout - Fluorescence example 🚧 #83
Draft
jsnel
wants to merge
1
commit into
glotaran:main
Choose a base branch
from
jsnel:feature/project_api_examples
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,4 @@ kinetic: | |
- 0.07 | ||
- 0.02 | ||
- 0.00016 | ||
- {non-negative: true} | ||
# - {non-negative: true} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
version: 0.7.0.dev0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
model: models/model.yml | ||
parameters: parameters/parameters.yml | ||
data: | ||
dataset1: dataset1.nc | ||
clp_link_tolerance: 0.0 | ||
clp_link_method: nearest | ||
maximum_number_function_evaluations: null | ||
add_svd: true | ||
ftol: 1e-08 | ||
gtol: 1e-08 | ||
xtol: 1e-08 | ||
optimization_method: TrustRegionReflection | ||
result_path: null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
pyglotaran_examples/study_fluorescence/tryout_project_api.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from pathlib import Path | ||
from timeit import default_timer as timer | ||
|
||
import matplotlib.pyplot as plt # 3.3 or higher | ||
from glotaran.project.project import Project | ||
from pyglotaran_extras.plotting.plot_overview import plot_overview | ||
|
||
if __name__ == "__main__": | ||
project_file = Path(".") / "project.gta" | ||
project_folder = project_file.parent | ||
project = Project.open(project_file) | ||
|
||
project.load_data("dataset1.ascii") | ||
# Would prefer to decouple dataset label and filename | ||
|
||
start = timer() | ||
project.optimize( | ||
# model_name="model.yml", # note if you use 'model' it will pick the wrong file | ||
# parameters_name="parameters.yml", | ||
model_name="model-target.yaml", | ||
parameters_name="parameters-target.yaml", | ||
maximum_number_function_evaluations=100, | ||
result_name="dummy", | ||
) | ||
end = timer() | ||
print(f"Total time: {end - start}") | ||
|
||
result = project.load_latest_result("dummy") | ||
|
||
print(result.markdown(True)) | ||
|
||
res = result.data["dataset1"] | ||
print(res) | ||
|
||
fig, _ = plot_overview(result, linlog=False, figure_only=False) | ||
plt.show(block=True) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check notice
Code scanning / CodeQL
Unused global variable