nu-radio / radiotools Goto Github PK
View Code? Open in Web Editor NEWA tool package for cosmic-ray and neutrino radio detectors
License: GNU General Public License v3.0
A tool package for cosmic-ray and neutrino radio detectors
License: GNU General Public License v3.0
Since we have implemented some basic unittests so far, we should implement CI to exploit the full power of these tests.
When I have some free time I will give it a shot and will try to start with one of the most common CI's (e.g. something like travis ci). At the beginning only some simple routines are needed I think.
Any objections @cg-laser ?
Executing from radiotools import helper
on Python3.11 fails with
>>> from radiotools import helper
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/homebrew/lib/python3.11/site-packages/radiotools/helper.py", line 4, in <module>
from radiotools.atmosphere import models as atm
File "/opt/homebrew/lib/python3.11/site-packages/radiotools/atmosphere/models.py", line 3, in <module>
from past.builtins import xrange
File "/opt/homebrew/lib/python3.11/site-packages/past/builtins/__init__.py", line 43, in <module>
from past.builtins.noniterators import (filter, map, range, reduce, zip)
File "/opt/homebrew/lib/python3.11/site-packages/past/builtins/noniterators.py", line 24, in <module>
from past.types import basestring
File "/opt/homebrew/lib/python3.11/site-packages/past/types/__init__.py", line 25, in <module>
from .oldstr import oldstr
File "/opt/homebrew/lib/python3.11/site-packages/past/types/oldstr.py", line 5, in <module>
from collections import Iterable
ImportError: cannot import name 'Iterable' from 'collections' (/opt/homebrew/Cellar/[email protected]/3.11.6/Frameworks/Python.framework/Versions/3.11/lib/python3.11/collections/__init__.py)
When running: the test code in coordinatesystems.py (python2 radiotools/coordinatesystems.py)
File "radiotools/coordinatesystems.py", line 138, in transform_to_vxB_vxvxB nX, nY = station_position.shape ValueError: need more than 1 value to unpack
This happens when transforming a single station position.
Line 143 looks like it should catch this case (array with shape (3,)) however it never reaches this point.
if(len(station_position.shape) == 1):
Adding somethink like
# if a single station position is transformed: (3,) -> (1, 3) if station_position.ndim == 1: station_position = np.expand_dims(station_position, axis=0)
would solve this issue. However than the test code does not return same values for the vector is both coordinate systems (are they supposed to do that?).
The homepage mentions that the default unit for angles is radians, however everywhere in the documentation and examples degrees are used. This is particularly confusing when looking at the documentation of the __init__
function for cstrafo
, where the zenith and azimuth descriptions are in degrees. If this could be updated to use radians instead, it would help first time users like me tremendously ๐๐ฝ
I was trying to install the latest version in my Python 3.9 virtual environment, but kept getting this error:
ImportError: urllib3 v2.0 only supports OpenSSL 1.1.1+
Even though I downgraded my urllib
package to version 1.26.6. After digging around for a while I managed to track down the issue to the project's TOML file. With TOML files, an isolated build environment is created. In this build environment, urllib v2.0+
was installed, leading to the crash. A simple fix for this is to add the build requirement "urllib3 < 2.0"
.
Can this be added or does this potentially cause (security) issues?
Hi,
this might be a good place to share opinions about the conversion to a python 2 and 3 compatible library?!
I started a corresponding branch! Please share any opinion.
Issue
Creating a radiotools.atmosphere.refractivity.RefractivityTable
with curved=True
throws an error by the attempt at creating an inhomogenous numpy array. In get_cached_table_curved_atmosphere
, the list self._distances
is appended with arrays of different sizes (distances = np.arange(...)
with variable ending and fixed stepsize). Creating an array from this (line 234) throws the error.
Minimal working example
from radiotools.atmosphere import refractivity
tab = refractivity.RefractivityTable(curved=True)
radiotools/radiotools/atmosphere/refractivity.py
Lines 222 to 234 in 60d0be0
Hi @cg-laser,
this is related to the merged PR #38. The observation level have to be used consistently in functions like:
_get_vertical_height_numeric
or _get_distance_xmax
. Do you agree?
What I do not quite see is how that effects the calculation via taylor expansions. It is necessary to just include the obersvation_level there too? Or does one need to repeat the determination of the used parameter.
Cheers
Hi @cg-laser,
is there a reason why using while in the code below:
def get_normalized_angle(angle, degree=False, interval=np.deg2rad([0, 360])): import collections if degree: interval = np.rad2deg(interval) delta = interval[1] - interval[0] if(isinstance(angle, (collections.Sequence, np.ndarray))): angle[angle >= interval[1]] -= delta angle[angle < interval[0]] += delta else: while (angle >= interval[1]): angle -= delta while (angle < interval[0]): angle += delta return angle
PS: is there a better way to reference code from the repo?
On a fresh install of a python environment with Python 3.10.12
and pip 22.0.2
and installing this project via pip install radiotools
importing radiotools fails with
ModuleNotFoundError: No module named 'past'
ModuleNotFoundError: No module named 'scipy'
add
It seems that on the last PR merged the py2 pipeline failed. However the failure seemed not to be related to the changes (based on the log). Or are they? Regardless of this. Is it worth keeping py2 compatibility and the checks or should we remove them?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.