IAP GITLAB
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
corsika
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pranav Sampathkumar
corsika
Commits
fbd877af
Commit
fbd877af
authored
4 years ago
by
Dominik Baack
Committed by
ralfulrich
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Split SaveBoostHistogram into seperate files
parent
50069c02
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
corsika/detail/framework/utility/SaveBoostHistogram.inl
+3
-12
3 additions, 12 deletions
corsika/detail/framework/utility/SaveBoostHistogram.inl
corsika/framework/utility/SaveBoostHistogram.hpp
+31
-0
31 additions, 0 deletions
corsika/framework/utility/SaveBoostHistogram.hpp
with
34 additions
and
12 deletions
corsika/framework/utility/SaveBootHistogram.
hpp
→
corsika/
detail/
framework/utility/SaveBoo
s
tHistogram.
inl
+
3
−
12
View file @
fbd877af
...
...
@@ -21,16 +21,6 @@
namespace
corsika
{
enum
class
SaveMode
{
overwrite
,
append
};
/**
* This functions saves a boost::histogram into a numpy file. Only rather basic axis
* types are supported: regular, variable, integer, category<int>. Only "ordinary" bin
* counts (i.e. a double or int) are supported, nothing fancy like profiles.
*
* Note that this function makes a temporary, dense copy of the histogram, which could
* be an issue for huge sizes (e.g. for high dimensions)
*/
template
<
class
Axes
,
class
Storage
>
inline
void
save_hist
(
boost
::
histogram
::
histogram
<
Axes
,
Storage
>
const
&
h
,
std
::
string
const
&
filename
,
SaveMode
mode
=
SaveMode
::
append
)
{
...
...
@@ -111,5 +101,6 @@ namespace corsika {
cnpy
::
npz_save
(
filename
,
"data"
,
temp
.
get
(),
axes_dims
,
mode_str
);
// In Python this array can directly be assigned to a histogram view if that
// histogram has its axes correspondingly: hist.view(flow=True)[:] = file['data']
}
}
// namespace corsika
}
// namespace corsika
}
// namespace corsika
\ No newline at end of file
This diff is collapsed.
Click to expand it.
corsika/framework/utility/SaveBoostHistogram.hpp
0 → 100644
+
31
−
0
View file @
fbd877af
/*
* (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu
*
* This software is distributed under the terms of the GNU General Public
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of
* the license.
*/
#pragma once
#include
<boost/histogram.hpp>
namespace
corsika
{
enum
class
SaveMode
{
overwrite
,
append
};
/**
* This functions saves a boost::histogram into a numpy file. Only rather basic axis
* types are supported: regular, variable, integer, category<int>. Only "ordinary" bin
* counts (i.e. a double or int) are supported, nothing fancy like profiles.
*
* Note that this function makes a temporary, dense copy of the histogram, which could
* be an issue for huge sizes (e.g. for high dimensions)
*/
template
<
class
Axes
,
class
Storage
>
inline
void
save_hist
(
boost
::
histogram
::
histogram
<
Axes
,
Storage
>
const
&
h
,
std
::
string
const
&
filename
,
SaveMode
mode
=
SaveMode
::
append
);
}
// namespace corsika
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment