python

A Comprehensive Guide to Python Project Management and Packaging: Concepts Illustrated with uv – Part I – Reinforced Knowledge




python

Python Challenge answers 0 thru 4... in clojure

The Python Challenge is a nifty site that presents you with a series of puzzles that it asks you to solve using python; getting each answer allows you to move on to the next puzzle.

Python is a cool language and it's a good tool for this job1 However, I'm learning clojure right now, so I thought it would be fun to try and solve a few of them in clojure. Here's my answers for challenges 0 thru 4 (warning: if you want to do these puzzles yourself, reading further now might ruin the fun)

Challenge #0 (the "Warmup")

Asks you to solve 2 to the 38th power:

(clojure.contrib.math/expt 2 38)

i.e. just use the exponent function in clojure contrib.

Challenge #1

This one throws some scrambled text at you and a clue on what the key is (ROT 2):

(defn translate [text]
  (let [lookup (vec (map char (range 97 123)))]
    (letfn [(letter? [c] (and (>= (int c) 97) (<= (int c) 122)))
            (shift-2 [c] (mod (+ 2 (- (int c) 97)) 26))]
      (apply str (map #(if (letter? %) (get lookup (shift-2 %)) %) text)))))

Create a lookup table of the chars, a predicate to test if a char is a letter. & a function to get the index of 2nd to next letter (the index loops, essentially making lookup as a ring buffer), then map across the given text, shifting by 2 if its a letter or just returning the char if its not.

Challenge #2

This one throws a big hunk of random data at you and suggests you pick out the 'rare' characters:

(defn filter-file [path]
  (let [fs (line-seq (clojure.contrib.io/reader path))
        lookup (set (map char (range 97 123)))]
    (apply str (mapcat #(filter lookup %) fs))))

A quick visual scan of the text led me to a strong hunch the "rare"2 characters were lowercase alpha, so:

Re-use our lookup table from the last challenge; this time make it a set, then use the set to filter each line of the file denoted by 'path' (I first saved the text to a file to make it easier to work with); use mapcat to flatten the lines out (this has the effect of stripping empty lines altogether); apply str to the resulting sequence to get the answer.

Challenge #3

This one's a big hunk of text too, so a quick refactoring of our last solution results in a more abstract (and higher-order) function that takes a filter function as an additional parameter:

(defn filter-file [filter-fn path]
    (apply str (mapcat filter-fn (line-seq (io/reader path)))))

the filter from challenge #2 thus becomes an argument; partial works nicely here:

(filter-file (partial filter (set (map char (range 97 123)))) "path/to/file")

Now we can make a new filter for challenge #3. This one will need to find character patterns that look like this: ABCxDEF. We'll need grab x. This one just screamed regex at me, so here's a filter that gives us the answer:

#(second (re-find #"[^A-Z][A-Z]{3}([a-z])[A-Z]{3}[^A-Z]" %)))

An anonymous function3 that uses re-find to match: "not-cap followed by 3 CAPS followed by not-cap followed by 3 CAPS followed by not-cap"; the second element of the resulting vector (because we use parens to create a group) produces x; mapcat et al do the rest.

Two big assumptions/limitations here: assumes each target is on its own line, and that the target pattern wasn't on the beginning or end of the line (which was good enough to get the answer).

Challenge #4

This challenge requires one to follow a url call chain, passing a different number as the argument to a 'nothing' parameter each time. The resulting page text provides the next number to follow (and/or some noise to keep you on your toes) until eventually we get the answer.

This one gets kinda ugly.

This is the kind of problem scripting languages are made for (e.g. perl, python & ruby coders would all make short work of this problem). Still, it's possible to write procedural code in clojure, and it's still reasonably straightforward.

One decision I had to make is how to GET the url's - my weapon of choice for this sort of thing is clj-http:

(require '[clj-http.client :as client])
(require '[clojure.contrib.string :as string]

(defn follow-chain [base-url number]
  (let [result (:body (client/get (str base-url number)))
        idx (.indexOf result "and the next")]
    (cond
      (re-find #"^Yes" result) (do
                                 (println result)
                                 (follow-chain base-url (/ (Integer/parseInt number) 2)))
      (= -1 idx)               result
      :else                    (let [result-vec (string/split (subs result idx) #" ")
                                     next-number (last result-vec)]
                                 (println result)
                                 (recur base-url next-number)))))

Take the url as a base & the first number to follow; use client-http/get to grab the page; extract the body of the page; get the index of the phrase "and the next" using the java "indexOf" method - we'll use the index later to parse out the end of the text and get the next number...

...unless of course, we get text that tells us something else (like a message saying "Yes" and then instructing us to divide the last number by two and continue on as before) so...

...we set up a switch using the cond macro: If the result starts with "Yes" make a recursive call dividing the last number by two; if indexOf otherwise came up empty, that's our answer, so return it; else pick the next number out of the result by splitting the end of the string into a vector (using clojure.contrib.string/split) and recur (tail recursively call the function again).

The println's could be removed, although they were essential when figuring out what the code needed to do.

Conclusion

This was a fun exercise; clojure's holding up pretty well so far, though clojure would not be my weapon of choice for that last one; if I choose to do the next five, I'll post them in a future article.

Footnotes

[1] It's also the darling of the hipster crowd right now -- in many cases the same people who snubbed python when ruby was the hip language about a decade ago... python abides.

[2] The official challenge answers also tackle ways to deduce "rare"; knock yourself out

[3] #() defines a function where % %2 etc represent positional parameters; the (fn [arg]) syntax would work here too




python

python module itertools

list of useful methods of itertools module.

permutationscombinationscombinations_with_replacementzip_longestcountrepeatcycleaccumulateproductgroupbyteeisslicechainchain.from_iterablefilterfalsedropwhile

realpython.com




python

LXer: Void Linux (Finally) Bids Farewell to Python 2

Published at LXer: Void Linux finally replaces Python 2 with Python 3 and upgrades its buildbot to enhance package delivery. Read More......



  • Syndicated Linux News


python

Episode 75: Monty Python and the Holy Podcast

The guys decided it was time to discuss a classic: Monty Python and the Holy Grail. They discuss how love demands honoring people’s quirks, how each of us desires to be the hero in our own stories, and how a little bit of laughter goes a long way in dealing with life. They close with their Top 5 Reimagined Myths.




python

Sculptor strives for fitting Monty Python statue

A fundraising drive for a Terry Jones memorial statue in Colwyn Bay nears its £100,000 target.




python

Mobile robot programming: adventures in Python and C (2nd ed.)

This book serves as a comprehensive guide for individuals interested in mobile robotics, including: (i) novices interested in programming simple simulated robots; (ii) individuals with basic knowledge of robotics, that is, intermediate learners, who seek to know




python

Natural language processing: a textbook with Python implementation

I had one big question after taking on this review: How relevant is this book with the advent of large language models (LLMs)? In the past two years, the launches of OpenAI’s GPT and Google’s Gemma, amongst others, have severely disrupted the study of natural language




python

PyFaults: a Python tool for stacking fault screening

Here, an open-source Python library for identifying and screening potential stacking fault models in crystalline materials with planar disorder is presented.




python

StreamSAXS: a Python-based workflow platform for processing streaming SAXS/WAXS data

StreamSAXS is a Python-based small- and wide-angle X-ray scattering (SAXS/WAXS) data analysis workflow platform with graphical user interface (GUI). It aims to provide an interactive and user-friendly tool for analysis of both batch data files and real-time data streams. Users can easily create customizable workflows through the GUI to meet their specific needs. One characteristic of StreamSAXS is its plug-in framework, which enables developers to extend the built-in workflow tasks. Another feature is the support for both already acquired and real-time data sources, allowing StreamSAXS to function as an offline analysis platform or be integrated into large-scale acquisition systems for end-to-end data management. This paper presents the core design of StreamSAXS and provides user cases demonstrating its utilization for SAXS/WAXS data analysis in offline and online scenarios.




python

Spexwavepy: an open-source Python package for X-ray wavefront sensing using speckle-based techniques

In situ wavefront sensing plays a critical role in the delivery of high-quality beams for X-ray experiments. X-ray speckle-based techniques stand out among other in situ techniques for their easy experimental setup and various data acquisition modes. Although X-ray speckle-based techniques have been under development for more than a decade, there are still no user-friendly software packages for new researchers to begin with. Here, we present an open-source Python package, spexwavepy, for X-ray wavefront sensing using speckle-based techniques. This Python package covers a variety of X-ray speckle-based techniques, provides plenty of examples with real experimental data and offers detailed online documentation for users. We hope it can help new researchers learn and apply the speckle-based techniques for X-ray wavefront sensing to synchrotron radiation and X-ray free-electron laser beamlines.




python

Savvy Coders Offers New Data Analytics + Python Course

Enrolling Now-Students Can Learn The Basics of Business Intelligence To Pursue New Careers Or Elevate Their Skill Sets




python

Python at Scale Summit, Presented by NumFOCUS Opens the Call for Proposals

The talks can be submitted from May 23rd to August 1st




python

Mastering f-strings in Python

Discover how to leverage Python's f-strings (formatted string literals) to write cleaner, more efficient, and more readable code.




python

Setting up a Python Project Using asdf, PDM, and Ruff

When I was tasked with looking into alternative ways to set up a new Python project (not just using the good ol' pip and requirements.txt setup), I decided to try to find the tools that felt best to me, as someone who writes Python and Ruby. On this journey, I found a way to manage dependencies in Python that felt as good as bundler, among other great tools.

The Runtime Version Manager #

asdf has been my primary tool of choice for language version management for multiple years now. The ease of adding plugins and switching between versions of those plugins at a local or global level has saved me massive amounts of time compared to alternatives.

If you've never set up asdf before, follow the instructions here to get it set up. For reference, I use fish for my shell, so I installed asdf using the "Fish & Git" section.

Once you have asdf on your machine, the next step is to add the plugins you need for your project. Plugins are the actual tools that you want to manage the versions of, like NodeJS, Python, Ruby, etc. For the purposes here, I'll start with adding the plugin for Python:

asdf plugin-add python

Once you have added a plugin to asdf, you're ready to install various versions of that plugin. Since we just installed Python, we can install the version we want:

asdf install python 3.12.4
# OR if we want to just use whatever the latest version is
asdf install python latest

Once the version you want is installed, you can tell asdf to use that version in the current directory by running:

asdf local python 3.12.4
# OR 
asdf local python latest

depending on which version of python you installed.

The Dependency Manager #

In the past, I just used pip install and requirements file(s) to handle most of this. I knew of other options, like pipx or pipenv, but I still have never tried using them. I was more interested in finding a dependency manager that did these things in a significantly different way than what I was used to with pip.

Therefore, I wanted to find something that felt similar to bundler for Ruby. Luckily, very early on in my journey here, I found PDM.

Upon reading what PDM did, I immediately decided to try it out and get a feel for what it offered. Some key notes for me that piqued my interest:

  • Lockfile support
  • Can run scripts in the "PDM environment"
    • pdm run flask run -p 3000 executes the normal flask run -p 3000 command within the context of your installed packages with PDM.
    • In other words, it adheres to PEP 582 and allows you to run project commands without needing to be in a virtual environment, which to me is a big plus.
  • Similar commands to bundler
    • pdm run => bundle exec
    • pdm install => bundle install
    • pdm add <package> => bundle add <gem-name>
      • Note: My workflow was almost always to just add gem <gem-name> to the Gemfile rather than using bundle add, but there is no direct 1:1 equivalent of a Gemfile with PDM.

Installing PDM #

PDM has its own asdf plugin, so let's just use that here as well! Running:

asdf plugin-add pdm

adds the plugin itself to asdf, and running:

asdf install pdm latest 
# can replace 'latest' with a specific version number here too

installs the latest version of PDM. Finally, set the local version with:

asdf local pdm latest
Side note about asdf local
  asdf local creates a .tool-versions file (if it doesn't already exist) in the current working directory, and appends the plugin and version number to it. At this point, the directory in which you ran asdf local python 3.12.4 and asdf local pdm latest should have that .tool-versions file, and the contents should be a line each for Python and PDM with their associated version numbers. This way, if someone else pulls down your project, they can just run asdf install and it will install the versions of those plugins, assuming the user has the necessary plugins added themselves.

Now that we have PDM and Python set up, we're ready to use PDM to install whichever packages we need. For simplicity, let's set up a simple Flask app:

pdm add flask flask-sqlalchemy flask-htmx

This line adds Flask, Flask-SQLAlchemy and Flask HTMX. Flask is a web application framework, Flask-SQLAlchemy adds SQLAlchemy and its ORM, and HTMX builds on top of HTML to allow you to write more powerful HTML where you'd otherwise need some JS. Side note, but HTMX is really cool. If you haven't used it before, give it a go! I'm even a part of the exclusive group of HTMX CEOs.

Linting and Formatting #

Finally, I wanted to find a way to avoid pulling in multiple packages (commonly, Black, Flake8 and isort) to handle linting and formatting, which felt to me like it could be the job of one tool.

Pretty quickly I was able to find Ruff which did everything I wanted it to, along with being really fast (thanks Rust ????).

First things first, we need to install Ruff. Since it's a Python package, we can do it using PDM:

pdm add ruff

Once it's installed, we can use ruff check and ruff format to lint and format, respectively. Note that since we installed via PDM, we need to prepend those ruff calls with pdm run:

pdm run ruff check --fix

This runs the linter and fixes any issues found (if they are automatically fixable). The linter can also be run in --watch mode:

pdm run ruff check --watch

which re-lints on every saved change and tells you of any new errors it finds.

The Ruff formatter is similar to use:

pdm run ruff format

which will automatically fix any formatting issues that it finds and can fix. If you want to use this in CI (which you should), you can use the --check flag that will instead exit with a non-zero status code, rather than actually formatting the files:

pdm run ruff format --check

Bringing it all together #

Working with projects set up this way is much easier than how I used to do it. Using tools like asdf, PDM, and Ruff rather than pyenv, pip, and Black/Flake8/isort make both setting up projects and pulling down/installing existing projects more straightforward. I hope the contents of this article are helpful to anyone interested in setting up Python projects in a similar way.




python

Episode 431: Ken Youens-Clark on Learning Python

Felienne spoke with Youens-Clark about new features in Python, why you should teach testing to beginners from the start and the importance of the Python ecosystem.




python

Episode 516: Brian Okken on Testing in Python with pytest

In this episode, we explore the popular pytest python testing tool with author Brian Okken, author of Python Testing with pytest. We start by discussing why pytest is so popular in the Python community: its focus on simplicity, readability, and developer ease-of-use; what makes pytest unique; the setup and teardown of tests using fixtures, parameterization, and the plugin ecosystem; mocking; why we should design for testing, and how to reduce the need for mocking; how to set up a project for testability; test-driven development, and designing your tests so that they support refactoring. Finally, we consider some complementary tools that can improve the python testing experience.




python

SE Radio 589: Zac Hatfield-Dodds on Property-Based Testing in Python

Zac Hatfield-Dodds, the Assurance Team Lead at Anthropic, speaks with host Gregory M. Kapfhammer about property-based testing techniques and how to use them in an open-source tool called Hypothesis. They discuss how to define properties for a Python function and implement a test case in Hypothesis. They also explore some of the advanced features in Hypothesis that can automatically generate a test case and perform fuzzing campaigns.




python

SE Radio 622: Wolf Vollprecht on Python Tooling in Rust

Wolf Vollprecht, the CEO and founder of Prefix.dev, speaks with host Gregory M. Kapfhammer about how to implement Python tools, such as package managers, in the Rust programming language. They discuss the challenges associated with building Python infrastructure tooling in Python and explore how using the Rust programming language addresses these concerns. They also explore the implementation details of Rust-based tooling for the Python ecosystem, focusing on the cross-platform Pixi package management tool, which enables developers to easily and efficiently install libraries and applications in a reproducible fashion. Brought to you by IEEE Computer Society and IEEE Software magazine.




python

#359: Hadoop, JRuby, Grails, and Python Creators Talk Tech Trends

Recorded live on Tuesday October 23, 2018 at Oracle Code One in San Francisco, this very special program brings together Doug Cutting (Chief Architect, Cloudera), Charles Nutter (Co-Lead, JRuby), Graeme Rocher (Project Lead, Grails Open Source Project), and Guido van Rossum (Creator, Python Language) to share their insight and expertise on the trends and technologies that have had the greatest impact on IT and software development over the past year, and will continue to shape the future.

View the complete show notes.




python

Gilad Gressel On Why You Should Watch His Newest Course: Deep Learning With Python

Hi, my name is Gilad Gressel and I’d like to tell you about my new course: Deep Learning with Python. Deep learning is an old technology that has recently been sweeping through the field of machine learning and artificial intelligence. Deep learning powers many of the cutting edge technologies that appear to be “magic” in [...]




python

פרילנסר /ית לפיתוח Python

אני מחפש עבור חברה מבוססת, מפתח חזק עם נגיעה בארכיטקטורה ודיזיין מישהו שיודע לקחת אחראיות מלאה על קוד ולרוץ משם. נחוץ ידע בפיתוח Python. יתרון להיכרות עם AWS/GCP, microservices.ניסיון מוצרי ואפליקטיבי.מדובר במשרה מלאה, במודל היברידי של יומיים במשרד.** המשרה פונה לעצמאים או שכירים בלבד**** חברות תכנה בבקשה לא לפנות **




python

src layout vs flat layout - Python Packaging User Guide




python

What's the difference between a module and package in Python? - Stack Overflow





python

Eric Idle Says the Monty Python Feud Is ‘Only About Money’

By JM McNab Published: November 11th, 2024




python

South Carolina woman finds python behind her toilet

A South Carolina woman ended up calling the police for help after she walked into her apartment's bathroom and found a large ball python behind her toilet.




python

Pet python missing for two months found at Chili's

A large ball python found slithering in the parking lot of a Chili's restaurant in North Carolina turned out to have been an escaped pet missing for two months.




python

Getting Started with Python Integration to SAS Viya for Predictive Modeling - Comparing Logistic Regression and Decision Tree

Comparing Logistic Regression and Decision Tree - Which of our models is better at predicting our outcome? Learn how to compare models using misclassification, area under the curve (ROC) charts, and lift charts with validation data. In part 6 and part 7 of this series we fit a logistic regression [...]

Getting Started with Python Integration to SAS Viya for Predictive Modeling - Comparing Logistic Regression and Decision Tree was published on SAS Users.




python

Python Integration to SAS® Viya® - Executing SQL on Snowflake

Welcome to the continuation of my series Getting Started with Python Integration to SAS Viya. Given the exciting developments around SAS & Snowflake, I'm eager to demonstrate how to effortlessly connect Snowflake to the massively parallel processing CAS server in SAS Viya with the Python SWAT package. If you're interested [...]

Python Integration to SAS® Viya® - Executing SQL on Snowflake was published on SAS Users.




python

Getting Started with Python Integration to SAS Viya for Predictive Modeling - Fitting a Random Forest

Learn how to fit a random forest and use your model to score new data. In Part 6 and Part 7 of this series, we fit a logistic regression and decision tree to the Home Equity data we saved in Part 4. In this post we will fit a Random [...]

Getting Started with Python Integration to SAS Viya for Predictive Modeling - Fitting a Random Forest was published on SAS Users.




python

Getting Started with Python Integration to SAS Viya for Predictive Modeling - Fitting a Gradient Boosting Model

Fitting a Gradient Boosting Model - Learn how to fit a gradient boosting model and use your model to score new data In Part 6, Part 7, and Part 9 of this series, we fit a logistic regression, decision tree and random forest model to the Home Equity data we [...]

Getting Started with Python Integration to SAS Viya for Predictive Modeling - Fitting a Gradient Boosting Model was published on SAS Users.




python

μWaveRiders: New Python Library Provides a Higher-Level API in the Cadence AWR Design Environment

A new Python library has been written to facilitate an interface between Python and AWR software using a command structure that adheres more closely to Python coding conventions. This library is labeled "pyawr-utils" and it is installed using the standard Python pip command. Comprehensive documentation for installing and using pyawr-utils is available.(read more)




python

Training Webinar: Fast Track RTL Debug with the Verisium Debug Python App Store

As a verification engineer, you’re surely looking for ways to automate the debugging process. Have you developed your own scripts to ease specific debugging steps that tools don’t offer? Working with scripts locally and manually is challenging—so is reusing and organizing them. What if there was a way to create your own app with the required functionality and register it with the tool? The answer to that question is “Yes!” The Verisium Debug Python App Store lets you instantly add additional features and capabilities to your Verisium Debug Application using Python Apps that interact with Verisium Debug via the Python API. Join me, Principal Education Application Engineer Bhairava Prasad, for this Training Webinar and discover the Verisium Debug Python App Store. The app store allows you to search for existing apps, learn about them, install or uninstall them, and even customize existing apps. Date and Time Wednesday, November 20, 2024 07:00 PST San Jose / 10:00 EST New York / 15:00 GMT London / 16:00 CET Munich / 17:00 IST Jerusalem / 20:30 IST Bangalore / 23:00 CST Beijing REGISTER To register for this webinar, sign in with your Cadence Support account (email ID and password) to log in to the Learning and Support System*. Then select Enroll to register for the session. Once registered, you’ll receive a confirmation email containing all login details. A quick reminder: If you haven’t received a registration confirmation within one hour of registering, please check your spam folder and ensure your pop-up blockers are off and cookies are enabled. For issues with registration or other inquiries, reach out to eur_training_webinars@cadence.com . Like this topic? Take this opportunity and register for the free online course related to this webinar topic: Verisium Debug Training To view our complete training offerings, visit the Cadence Training website Want to share this and other great Cadence learning opportunities with someone else? Tell them to subscribe . Hungry for Training? Choose the Cadence Training Menu that’s right for you. Related Courses Xcelium Simulator Training Course | Cadence Related Blogs Unveiling the Capabilities of Verisium Manager for Optimized Operations - Verification - Cadence Blogs - Cadence Community Verisium SimAI: SoC Verification with Unprecedented Coverage Maximization - Corporate News - Cadence Blogs - Cadence Community Verisium SimAI: Maximizing Coverage, Minimizing Bugs, Unlocking Peak Throughput - Verification - Cadence Blogs - Cadence Community Related Training Bytes Introducing Verisium Debug (Video) (cadence.com) Introduction to UVM Debug of Verisium Debug (Video) (cadence.com) Verisium Debug Customized Apps with Python API Please see course learning maps a visual representation of courses and course relationships. Regional course catalogs may be viewed here . *If you don’t have a Cadence Support account, go to Cadence User Registration and complete the requested information. Or visit Registration Help .




python

Error with launching Python Script Via AWRDE VBA Script

Hello Team,
I am currently following this AWR script posted on them, to run a python script directly from inside AWR using VBA script.

Launching Python from AWRDE VBA Script - AWR Scripts - AWR Knowledgebase

Following all the basic steps with no changes to the code. I have Vscode and python-3.12.2 installed in my system. 

This is the error I am getting while running this code. 

 

Thank you for your help 

Best Regards

SID




python

Applied text analysis with Python : enabling language-aware data products with machine learning [Electronic book] / Benjamin Bengfort, Rebecca Bilbro, and Tony Ojeda.

Sebastopol : O'Reilly Media, 2018.




python

Advanced Python scripting for ArcGIS pro [electronic resource] / Paul A. Zandbergen

Redlands, California : Esri Press, 2024




python

Matlab, Python, Julia: What to Choose in Economics? [electronic journal].




python

Algebraic graph algorithms [electronic resource] : a practical guide using Python / K. Erciyes.

Cham, Switzerland : Springer, 2021.




python

Python Developer - Team leader

Company: Hetang Bhavshar(Proprietor of HB Staffing Services
Experience: 5 to 12
Salary: 5.00 to 15.00
location: Ahmedabad
Ref: 24828929
Summary: We have Requirement For Python Developer Team leader




python

Immediate Hiring For Python Developer

Company: SP Staffing Services Private Limited
Qualification: Other
Experience: 1 to 5
Salary: 3.50 to 6.10
location: Chennai
Ref: 24374534
Summary: Immediate Hiring For Python Developer




python

Xenotix Python Keylogger For Windows

Xenotix is a keylogger for windows that is written in Python. It has the ability to send logs remotely.




python

High-performance Python for crystallographic computing

The Python programming language, combined with the numerical computing library NumPy and the scientific computing library SciPy, has become the de facto standard for scientific computing in a variety of fields. This popularity is mainly due to the ease with which a Python program can be written and executed (easy syntax, dynamical typing, no compilation etc.), coupled with the existence of a large number of specialized third-party libraries that aim to lift all the limitations of the raw Python language. NumPy introduces vector programming, improving execution speeds, whereas SciPy brings a wealth of highly optimized and reliable scientific functions. There are cases, however, where vector programming alone is not sufficient to reach optimal performance. This issue is addressed with dedicated compilers that aim to translate Python code into native and statically typed code with support for the multi-core architectures of modern processors. In the present article it is shown how these approaches can be efficiently used to tackle different problems, with increasing complexity, that are relevant to crystallography: the 2D Laue function, scattering from a strained 2D crystal, scattering from 3D nanocrystals and, finally, diffraction from films and multilayers. For each case, detailed implementations and explanations of the functioning of the algorithms are provided. Different Python compilers (namely NumExpr, Numba, Pythran and Cython) are used to improve performance and are benchmarked against state-of-the-art NumPy implementations. All examples are also provided as commented and didactic Python (Jupyter) notebooks that can be used as starting points for crystallographers curious to enter the Python ecosystem or wishing to accelerate their existing codes.




python

PyMDA: microcrystal data assembly using Python

The recent developments at microdiffraction X-ray beamlines are making microcrystals of macromolecules appealing subjects for routine structural analysis. Microcrystal diffraction data collected at synchrotron microdiffraction beamlines may be radiation damaged with incomplete data per microcrystal and with unit-cell variations. A multi-stage data assembly method has previously been designed for microcrystal synchrotron crystallography. Here the strategy has been implemented as a Python program for microcrystal data assembly (PyMDA). PyMDA optimizes microcrystal data quality including weak anomalous signals through iterative crystal and frame rejections. Beyond microcrystals, PyMDA may be applicable for assembling data sets from larger crystals for improved data quality.




python

Invasive Burmese pythons are taking a toll on Florida’s native birds

As researchers investigate the impact of the Burmese python in the Everglades, scientists from the Smithsonian Institution, South Florida Natural Resources Center and the University of Florida examined the snake’s predation of the area’s birds. They found that birds, including endangered species, accounted for 25 percent of the python’s diet in the Everglades.

The post Invasive Burmese pythons are taking a toll on Florida’s native birds appeared first on Smithsonian Insider.




python

Invasive pythons in Florida now stealing bird eggs straight from the nest

The snakes are not only eating the area’s birds, but also the birds’ eggs straight from the nest.

The post Invasive pythons in Florida now stealing bird eggs straight from the nest appeared first on Smithsonian Insider.




python

P2P File Sharing Application Python





python

18-foot Burmese python tips the scales at 150 pounds

Florida officials say they've bagged one of the biggest Burmese pythons ever found in the state: an 18.2-foot-long female weighing some 150 pounds.