Saravanan666/pypi-org huggingface dataset:
Package: astrospice
A package for finding SPICE kernels and using them with astropy coordinates.LicenseThis project is Copyright (c) David Stansby and licensed under
the terms of the BSD 3-Clause license. This package is based upon
theOpenastronomy packaging guidewhich is licensed under the BSD 3-clause licence. See the licenses folder for
more information.ContributingWe love contributions! astrospice is open source,
built on open source, and we’d love to have you hang out in our community.Imposter syndrome disclaimer: We want your help. No, really.There may be a little voice inside your head that is telling you that you’re not
ready to be an open source contributor; that your skills aren’t nearly good
enough to contribute. What could you possibly offer a project like this one?We assure you - the little voice in your head is wrong. If you can write code at
all, you can contribute code to open source. Contributing to open source
projects is a fantastic way to advance one’s coding skills. Writing perfect code
isn’t the measure of a good developer (that would disqualify all of us!); it’s
trying to create something, making mistakes, and learning from those
mistakes. That’s how we all improve, and we are happy to help others learn.Being an open source contributor doesn’t just mean writing code, either. You can
help out by writing documentation, tests, or even giving feedback about the
project (and yes - that includes giving feedback about the contribution
process). Some of these contributions may be the most valuable to the project as
a whole, because you’re coming to the project with fresh eyes, so you can see
the errors and assumptions that seasoned contributors have glossed over.Note: This disclaimer was originally written byAdrienne Lowefor aPyCon talk, and was adapted by
astrospice based on its use in the README file for theMetPy project.
Package: astrostreampy
streamPyTo create a stream model you need the following files:theIMAGEfileaMASKof all neabry, and overlapping sourcesif other stars or galaxies contaminate the stream's central region, create an additionalINTERPOLATION MASKfor sources to interpolate overAll have to be the same size, otherwise an error is raised. RGB.TIF,.jpgor.pngdoes not work, they need to be in gray scale.fitsformat.
TheIMAGEheader must contain the following keys:'FILTER'  : char, the band in which the image was taken.'PSF'     : float, the mean FWHM of the sources across the image in arc seconds. If there is no interest in the true intrinsic shape parameters of the stream set it to1.'PXSCALE' : float, the pixel scale of the image in arc seconds/pixel.'ZP'      : float, the photometric zero point.WalkthroughFirst import all necessary classes and methods and define the files as variables.from astrostreampy.Image.stream import Stream
from astrostreampy.Image.point import Point
from astrostreampy.BuilModel.autobuild import Model
from astrostreampy.BuildModel.modify import Modifier
from astrostreampy.BuildModel.aperture import fwhm_mask_from_paramtab

image = "image.fits"
mask = "mask.fits"
intmask = "interpolationmask.fits"Start by applying the masks using theStreamclass. Note that the masks are parsed as a list. This allows for multiple masks of the same type to apply simultaneously.stream = Stream(image,[mask],[intmask])
stream.apply_masks()Then the initial box position and dimensions can be set with thePointclass. It opens a figure where the point can be set with left mouse click and the box dimensions are chosen with the sliders on the left.
When satisfied close the plot by closing the window.stream.data()is the masked image.init_box = Point(stream.data)The modeling is setup and started with theModelclass. The example presents its shortest and simplest form.model = Model(stream.original_data, stream.data, stream.header, 
                  init_box.x, init_box.y, init_box.width, init_box.height, output="model")
model.build() # for further access get full model with .data
model.show() # for quality checksIfmodel.show()reveals that the algorithm went beyond the stream call the ````Modifier``` class to cut those regions off. A window opens displaying the image, model and residual. Type in the terminal the lower and upper indices sperated by "," and pressENTER. The model and residual changes based on the input. Repeat it as often as desired. When finished leave the line empty and pressENTERagain. It saves the modified files with prefix "mod_".Modifier("model_multifits.fits","model_paramtab.fits")If you are interested in photometric measurements useaperture = fwhm_mask_from_paramtab("mod_model_multifits.fits","mod_model_paramtab.fits"to create an aperture mask, which is anumpy.ndarray.
Package: astrotest
===Create tests from current behaviour===Imagine you have to refactor a large, undocumented (hence untested!) python code base.This utility captures this functionality by generating test cases during test executions of the code. This assists refactoring as the current expected behaviour has been captured.====Why 'Astrotest'?===='Astroturfing' is a term meaning to create inauthentic comments or discussion to influence or overwhelm natural organic debate. Hence 'Astro-testing': it's not authentically TDD; it can create a large number of tests automatically.====Example====If the following function has the test_logging decorator::@astro_testdef simplefn(a,b):return a+band is called with:simplefn(a=1,b=2)it'll create a unit test file with the following (comments etc. omitted):def test_simplefn(self):self.assertEqual(simplefn(a=1, b=2), 3)
Package: astro-tiptop
TIPTOPIn order to be able to easily predict the AO performance, we have developed
this fast algorithm producing the expected Adaptive Optics (AO seehttps://en.wikipedia.org/wiki/Adaptive_optics) Point Spread Function (PSF) for
any of the existing AO observing modes (Single-Conjugate-AO,
Laser-Tomographic-AO, Multi-Conjugate-AO, Ground-Layer-AO), and any atmospheric
conditions. This TIPTOP tool takes its roots in an analytical approach, where
the simulations are done in the Fourier domain. This allows to reach a very
fast computation time (few seconds per PSF with GPU acceleration), and
efficiently explore the wide parameter space.See the documentation here:https://tiptop.readthedocs.io
Package: astrotool
AstroToolA Python package for astronomical calculations in Python or on the command line.InstallationThis package can be installed usingpip install astrotool.  This should automatically install the dependency
packagesastroconst,colored_tracebackandnumpyif they haven't been installed already.  If you are
installing by hand, you have to ensure these packages are installed as well.AstroTool pagesPypi: AstroTool Python packageGitHub: AstroTool source codeRead the Docs: AstroTool documentationAuthor and licenceAuthor: Marc van der SluysContact:http://astro.ru.nl/~sluys/Licence:EUPL 1.2See alsoAstroConst: a Python package that provides astronomical constants.SolTrack: a free, fast and accuratePythonorC/C++routine to compute
the position of the Sun.elp-mpp02: accurate Moon positions using the lunar solution ELP/MPP02
in Python.libTheSky: a Fortran library to compute the positions of celestial
bodies (Sun, Moon, planets, stars, asteroids, comets) and events (e.g. lunar phases) with great accuracy.ReferencesMeeus,Astronomical algorithms, 2nd Ed.Celestial mechanics in a nutshell (CMiaNS): online living document.This Python code is being adapted from the Fortran implementation inlibTheSkyCopyright (c) 2021-2022 Marc van der Sluys
Package: astro-toolbox
Astro ToolboxThe astro_toolbox project is developped to allow amateur astronomer and observatory to perform observationnal astronomy calculations. This repository contain the source code of the project. At this moment the project represent an alpha version.InstallationUsepip install astro_toolboxto install last version or clone this repository and executemake install.Basic usageSynopsisastro-toolbox [options1] <command> <argument> [options2]Options 1-v, --verboseProgram verbosity.CommandsairmassThis command allows you to plot airmass map of one or multiple objects.argumentYou can enter one or many objects or a path to a file or a directory. If
you left it blank, it will search on your current directory a file named
observations.lstYou must end the name to a directory with a/examples:astro-toolbox airmass examples/astro-toolbox airmass examples/examples.lstastro-toolbox airmass betelgeuse vegaoptions-d, --dateOption to inform a different date-d 2022-12-18,
default is None (today date).-l, --locationOption to inform a location name-l Greenwich,
default is None (last location used).-o, --outputOption to inform the output directory (must end with a/)-o examples/, default is '' (current directory).--boundsOption which requires two hours arguments consider this
program calculates everything in UT--bounds 19 33mean we begin
calculations at 7pm and end these at 9am the next day.infoThis command allows you to query Simbad (for stars and deep sky objects)
or JPL Horizons for solar system objects.argumentEnter the object name as argumentoptions-d, --dateOption to inform a different date-d 2022-12-18,
default is None (today date).-l, --locationOption to inform a location name-l Greenwich,
default is None (last location used).locationThis command allows you to add, update or read a location.argumentEnter the location name, list allow you to display all locations saved.options-a, --addOption to add a new location (if it doesn't exists). It
will ask you longitude, latitude in degrees (0.0) or DMS (0°0'0") and
elevation in meters.-d, --deleteOption to delete a location (if it exists).-u, --updateOption to update an existing location it will ask the
same thing as adding option but left blank the data, you don't want to
change.polarisThis command allows you to display the polaris position (northern and
southern hemisphere) in a polar finder. This command doesn't need any
argument.options-d, --datetimeOption to inform a different date and time-d 2022-12-18:20:35:55, default is None (today date).-l, --locationOption to inform a location name-l Greenwich,
default is None (last location used).weatherThis command allows you to display forecasts of a given location.
This command doesn't need any argument.options-l, --locationOption to inform a location name-l Greenwich,
default is None (last location used).-d, --daysCounter to inform the number of days to display,
default is 1.-p, --pastCounter to inform the number of past days to display,
default is 0.DocumentationThe documentation is availale onreadthedocs.ioLicenseAstropy is licensed under a GNU GPL license - see theLICENSEfile.
Package: astrotraders
astrotradersA typed, handwrited and powerful library for spacetraders.io game.SpaceTraders is an API-based game where you acquire and manage a fleet of ships to explore, trade, and fight your way across the galaxy.This client based onHTTPXandPydantic.Installpip install astrotradersUsageCurrently, you can use API wrapper which  represented byAstroTradersClientclass:fromastrotradersimportAstroTradersClientclient=AstroTradersClient.set_up("token_here",)After initializing client you can use API resources, for example:agent=client.agents.info()systems=client.systems.list()contracts=client.contracts.list()factions=client.factions.list()# you can use undocumented endpoints!stats=client.server.stats()universe=client.systems.all()TODO"Game objects" with data caching and more pythonic usageCLI tool for manage fleet (and as example)
Package: astrotrails
AstrotrailsAstrotrails generates startrails images by stacking multiple photographs of the night sky.
It takes a series of individual night sky photos and combines them to create a composite image (and also a timelapse video) that showcases the apparent motion of stars as the Earth rotates.Installation using pippipinstallastrotrailsThis will put the executableastrotrailsin your pathRunning using command line interfaceastrotrailsjpegsDirectory1The execution of the above will search for jpegs files intojpegsDirectoryand will generate startrails image and timelapse video (mode 1)Running using graphical user interfaceastrotrails-gui
Package: astrotree
Welcome to astrotree!A lightweight, purely python package to handle reference trees.
This project evolved because of a personal urge to organize literature from my day-to-day.
Note that this is not a reference manager: if you are looking for a python-based reference manager, look no further thanPapis!This project helps you connect literature entries: given an article, you can choose to build a tree of other articles that connect to it. These are articles referenced in the article of interest (references), or works that cited it (citations). Trees can be built to arbitrary depths, limited only by resources available to python and records on the internet, at any level of the tree.The project presently uses the NASA-ADS API (seeADS Docs) to launch queries and is suited to my use case; any efforts to contribute and extend it to other APIs are welcome!InstallationInstall directly through pip:pip install astrotreePrerequisiteBefore you can start to use this application, you need to set an environment variableADSTOKEN, which needs to point to your ADS API token.
Follow the instructionshereto obtain your ADS API token.
You are subject to theADS API Terms of Servicethrough your use of this application.UsageThe application is CLI-based and has two modes: you may choose to build either a reference tree or a citation tree.
To build a reference tree, use:astrotree -id <ADS id> --refTo build a citation tree, use:astrotree -id <ADS id> --citeIn either case the output is a list of ADS IDs and the respective article titles, in a tree format. The tool offers you the opportunity to ask to build a tree for any of the listed IDs, restricted to the same mode you started with.Upon exit (press n when the application asks if you wish to continue), the tree is dumped to a text file containing the tree in the local directory, for future use.
Package: astro-tulips
tulipscreates diagrams of the structure and evolution of stars. It creates plots and movies based on output from
theMESAstellar evolution code.tulipsrepresents stars as circles of varying size and color.tulips' capabilities include visualizing the size and perceived color of stars, their interior
mixing and nuclear burning processes, their chemical composition, and comparing different MESA models.InstallationGeneralTo install tulips runpip install astro-tulipsFor more information, please have a look at the dedicatedinstallage pageof the tulips documentation.Note: Python 2 is not supportedDevelopment versionThe latest development version is available directly atbitbucketgit clone https://bitbucket.org/elaplace/tulips.git
cd tulips
pip install -e .DocumentationMore details, examples, and tutorials can be found in the tulipsdocumentationCiting TULIPSThe paperTULIPS: a Tool for Understanding the Lives, Interiors, and Physics of Starshas been accepted for
publication in Astronomy & Computing.If you use TULIPS for your research, please cite this article.LicenseThis work is distributed under a GNU general public license, version 3.ContributingIf you wish to submit a new feature or bug fix please don't hesitate to send a pull request or to submit an issue.Acknowledgmentstulips makes use of the open-source python modulesmesaPlotby R. Farmer,colorpyby M. Kness,CMasher,numpy,astropy,matplotlib, and ofipython/jupyter.
Logo design: A. Faber. Documentation: I. de Langen. Created and developed byEva Laplace.FundingThis project was funded by the European Unions Horizon 2020
research and innovation program from the European Research
Council (ERC, grant agreement No.715063) and the Netherlands
Organisation for Scientific Research (NWO) as part of the Vidi
research program BinWaves with project number 639.042.728.
TheET Outreach awardof the Royal Holland Society of Sciences and Humanities and its
sponsors E. van Dishoek and T. de Zeeuw are gratefully acknowledged for
making it possible to fund the work of I. de Langen on the TULIPS
documentation and tutorials.
Package: astrovishalPerceptronPkg-astrovishalthakur
Astrovishal's python packagePerceptron is called as hello world of Deep Learning or fundamental building block of Neural network.Following is a python package implementation of perceptron model. You can use it for simple Deep learning tasks like Classification.To installpipinstallastrovishalPerceptronPkg-astrovishalthakur==0.0.4How to use this packagefromastrovishal.PerceptronimportPerceptronmodel=Perceptron(eta=0.3,epochs=10)References -*official python docs for PYPI
Package: astrovision
AstrovisionThe compulsory Python library to work with satellite imagery.Pre-requisitesGDALmust be installed (source install_gdal.sh).InstallationpipinstallastrovisionDocumentationDocumentation can be found here:https://inseefrlab.github.io/astrovision/.ContributionTo contribute, refer toCONTRIBUTING.md. Astrovision is a poetry built project, to develop install the package withpip install -e .
Package: astrowidgets
Widgets for the Jupyter notebook and JupyterLabastrowidgetsaims to be a set of astronomy widgets for Jupyter Lab or Notebook,
leveraging the Astropy ecosystem. TheImageWidgetimplements the API documented athttps://github.com/eteq/nb-astroimage-apiWarningastrowidgetsis currently inveryearly development.  Nothing is guaranteed to work or do anything in particular
at this stage.Installation and DocumentationSeehttps://astrowidgets.readthedocs.io/en/latest/.LicenseSeeLICENSE.rst.ContributingGiven the pre-alpha nature of this package, there is no established
contributing guide. Please contact the maintainers for guidance.
It is important that you follow our code of conduct; please seeCODE_OF_CONDUCT.md.ChangelogSeeCHANGES.rst.
Package: astrow-images
Installpipinstallastrow-imagesUsageMemes:fromastrow_imagesimportmemes# for a discord bot@bot.command()asyncdefdrake(ctx,first,second):awaitctx.reply(file=discord.File(memes.drake(first,second)))# it's so easy to useEffects:fromastrow_imagesimporteffects@bot.command()asyncdefblur(ctx,user:discord.User):awaitctx.reply(file=discord.File(effects.blur(awaituser.avatar.read())))# 1 line go brrAdvanced Usage (recommended):fromastrow_imagesimporteffectsfromfunctoolsimportpartial@bot.command()asyncdefwiggle(ctx,user:discord.User):awaitctx.reply(file=discord.File(awaitbot.loop.run_in_executor(None,partial(effects.wiggle,img=awaituser.avatar.read()))))I won't be making docs for these, refer to the source code or ask in the support server if you have any questionsMeme templatesdrake,disappointed,flex_tape,bernie,panik,doge,my_heartEffectsblur,flip,rotate,enhance,ascii,blend,wiggle
Package: ast-scope
ast_scopeThis package is an implementation of Python's lexical scoping rules. It's interface is simple, you pass in an AST object to theannotatefunction, and it provides a mapping from each node in the tree that represents a symbol to the containing scope.Example Usage: Get Global SymbolsLet's say you have the codecode = """
def f():
    x = 3
    lambda z: theta
    return x + y
"""and you want to determine which global variables are referenced by it. All you need to do is runimport ast
import ast_scope
tree = ast.parse(code)
scope_info = ast_scope.annotate(tree)
global_variables = sorted(scope_info.global_scope.symbols_in_frame)Once you have executed this code,global_variableswill be bound to['f', 'theta', 'y'].Example Usage: Get Dependency GraphLet's say you have the codecode = """
def hailstone(n):
    if n == 1:
        return 1
    if n % 2 == 0:
        return hailstone(n // 2)
    if n % 2 == 1:
        return hailstone(3 * n + 1)

def mapper(f, lst):
    return list(map(f, lst))

def lrange(n):
    return list(range(n))

def main():
    return mapper(hailstone, lrange(20))
"""and you want to find the dependency graph. You can runimport ast
import ast_scope
tree = ast.parse(code)
scope_info = ast_scope.annotate(tree)
graph = scope_info.static_dependency_graphwhich results in the following directed graph of dependencies between top-level functions (rendering using networkx):See the documentation for some caveats.Example usage: find a specific symbol's scopeTake the following code:code = """
def f(x):
    def g(x): return x()
    return g(lambda: x)
"""First, parse the code and identify the node (in practice, you'd probably have this always).import ast, ast_scope
tree = ast.parse(code)
last_x = tree.body[0].body[-1].value.args[0].bodyIf you want to find the scope in which the lastxcould be found, just run the annotator and look up it's scope!# run the annotator
scope_info = ast_scope.annotate(tree)
scope_x = scope_info[last_x]You should get aFunctionScopeobject which contains a bunch of information about the other variables, etc., in the scope, but alsoscope_x.function_node, a pointer to the node containing thedefstatement forf.
Package: ast-selector
AST SelectorQuery AST elements by using CSS Selector-like syntax"Query AST elements 🌲 by using CSS Selector-like 💅 syntax."Installation and usageInstallationpip install ast-selectorUsagefromast_selectorimportAstSelectortree=load_python_code_as_ast_tree()query="FunctionDef Raise $FunctionDef"# Query all functions that raises at least an exceptionfunctions_raising_exceptions=AstSelector(query,tree).all()Use CasesFunctions that return intfromast_selectorimportAstSelectortree=load_python_code_as_ast_tree()query="FunctionDef.returns[id=int] $FunctionDef"# Query all functions that return ints e.g. def sum() -> intfunction_element=AstSelector(query,tree).first()LicenseMITCreditsIt's extremely hard to keep hacking on open source like that while keeping a full-time job. I thank God from the bottom of my heart for both the inspiration and the energy.
Package: ast-slizovskaia
Test implementation for Audio Spectrogram Transformer by Olga SlizovskaiaThis repository provides a test implementation of the Audio Spectrogram Transformer described in the originalpaper.
Please, note, that this implementation is lacking several important details compared to the original paper, such as dataset normalization, data augmentation routines and optimal hyperparameters selection.
The results that you will obtain using the code provided in this repository, will differ severely from the results reported in the original paper.RequirementsThis repository requires a working python3.9 installation and uses poetry for dependency management and packaging.Please, installpoetryusing the official guidelines.You also need to download theESC-50 datasetand
specify the path to the dataset asdataset_dirparameter inhparams.pyconfiguration file.InstallationTo install all necessary dependencies, run:poetry env use 3.9poetry installUsageWe use the standard 5-fold cross-validation scheme for evaluating the classification model. The folds are defined in the datasets meta file and hardcoded for training.
To train and evaluate the model, run:python train.pyorpoetry run python train.py.ResultsThe best test accuracy score achieved with this model without any pretraining is 0.39 as you can see in the following plot:The model overfits singnificantly reaching training loss values as low as 1.8 and only reaching validation and test loss values about 2.3.
Package: astspy
astspyastspy (Abstract Syntax Tree SPY) is an open source command line tool to
extract information from Python source code files.astspy can be used with Python 3 and 2 code, but make sure to
analyze files from each version in their respective environments.FeaturesPrint the names of classes and functions found in the fileCalculate an aproximation of the number of lines of code of each class
or function definition (sizes)See what functions or classes have docstringsPrint the locations of the definitions in the file (line numbers)Get stats from the sizes of the definitionsInstallationYou can install, upgrade, and uninstallastspy.pywith these commands:$pipinstallastspy$pipinstall--upgradeastspy$pipuninstallastspyHelpTo get help use:$astspy-h