Skip to main content

NASA Expects Chinese Crewed Mission Around the Moon In 2027

1 month 3 weeks ago
NASA Administrator Jared Isaacman says he expects China to fly taikonauts around the moon in 2027, "ratcheting up perceptions of a space race between China and the United States," reports SpaceNews. He is using that prospect to argue for a revamped Artemis strategy and an accelerated path toward a U.S. lunar return. From the report: "The next time the world tunes in to watch astronauts fly around the moon, which will likely be sometime in 2027, they will be taikonauts, and America will no longer be the exclusive power to send humans into the lunar environment," he said. While Isaacman has frequently discussed a race with China to be the next to land humans on the moon, this was one of the first times he predicted a 2027 Chinese crewed circumlunar mission. He repeated the comments later in the day at an industry reception. China has not publicly announced plans for such a mission, which, as Isaacman described it, would likely be similar to NASA's Artemis 2 mission in April. There have been rumors of a mission along those lines, though, and an expectation of a roadmap of missions leading to a Chinese crewed landing by the end of the decade. So far, all the crewed missions to fly around, orbit or land on the moon have been flown by NASA: nine Apollo missions from 1968 to 1972 and Artemis 2. All the astronauts on those missions have been Americans except for Canadian Space Agency astronaut Jeremy Hansen on Artemis 2. Isaacman has used the threat that China could land astronauts on the moon before NASA returns there as a rationale for revamping the Artemis lunar exploration program. In February, he announced that Artemis 3, which was to be a lunar landing attempt in 2028, will instead be a test flight in low Earth orbit in 2027, followed by a landing on Artemis 4 in 2028. In March, he changed other elements of Artemis at the agency's Ignition event, including effectively canceling the lunar Gateway to focus resources instead on a lunar base, while calling for a much higher cadence of robotic lander missions.

Read more of this story at Slashdot.

BeauHD

CodeSOD: In the Know

1 month 3 weeks ago

Delilah works in a Python shop. Despite Python's "batteries included" design, that doesn't stop people from trying to make their own batteries from potatoes. For example, her co-worker wrote this function:

def key_exists(element, key): if isinstance(element, dict): try: element = element[key] except KeyError: return False return True

Python, of course, has an in operator. key in dictionary is an extremely common idiom. There's no reason to implement your own. Certainly, there's no reason to re-implement it by catching and throwing exceptions.

This is ugly, stupid, and bad. It gets worse, though, when you see how it gets used.

for key in old_yaml_data: if key in new_yaml_data: if old_yaml_data[key] != new_yaml_data[key]: temp = new_yaml_data[key] new_yaml_data[key] = merge(new_yaml_data[key], old_yaml_data[key]) if key_exists(new_yaml_data[key], 'image') and key_exists(old_yaml_data[key], 'image'): new_yaml_data[key]['image'] = temp['image'] elif key == "databases": revert_db_tags(new_yaml_data[key], temp)

This code is attempting to upgrade "old" YAML data with "new" data. So it's basically merging dictionaries, which is a great case for the in operator.

And they use the correct idiom on the second line there! This was written by one developer! They do the standard key in new_yaml_data check. And they also use key_exists. I can only assume that they had a stroke between starting and finishing this script, which I'll note is, in total, 48 lines long.

Here's the whole short script, which is just generally a mess. Slapped together Python code that's trying to be a "smarter" shell script, but is definitely written with the elegance of hacked-together-bash.

import sys import yaml from jsonmerge import merge appHomePath = sys.argv[1] oldValuesYAML = appHomePath + "values.yaml" newValuesYAML = appHomePath + "/upgrade_version/values.yaml" with open(newValuesYAML, 'r') as f: new_yaml_data = yaml.load(f, Loader=yaml.loader.FullLoader) with open(oldValuesYAML, 'r') as f: old_yaml_data = yaml.load(f, Loader=yaml.loader.FullLoader) def key_exists(element, key): if isinstance(element, dict): try: element = element[key] except KeyError: return False return True def revert_db_tags(old_yaml_data, new_yaml_data): dbList = ["mongoDB", "postgresDB"] mongoDbTagsToRevert = ["mongoRestore"] mongodbKeysToDelete = [] postgresDbTagsToRevert = [] for db in dbList: old_yaml_data[db]['image'] = new_yaml_data[db]['image'] for mongoDbTag in mongoDbTagsToRevert: old_yaml_data['mongoDB'][mongoDbTag]['image'] = new_yaml_data['mongoDB'][mongoDbTag]['image'] for mongoDbTag in mongoKeysToDelete: del old_yaml_data['mongoDB'][mongoDbTag] for postgresDbTag in postgresDbTagsToRevert: old_yaml_data['postgresDB'][postgresDbTag]['image'] = new_yaml_data['postgresDB'][postgresDbTag]['image'] for key in old_yaml_data: if key in new_yaml_data: if old_yaml_data[key] != new_yaml_data[key]: temp = new_yaml_data[key] new_yaml_data[key] = merge(new_yaml_data[key], old_yaml_data[key]) if key_exists(new_yaml_data[key], 'image') and key_exists(old_yaml_data[key], 'image'): new_yaml_data[key]['image'] = temp['image'] elif key == "databases": revert_db_tags(new_yaml_data[key], temp) with open(newValuesYAML, 'w') as f: data = yaml.dump(new_yaml_data, f, sort_keys=False) [Advertisement] Plan Your .NET 9 Migration with Confidence
Your journey to .NET 9 is more than just one decision.Avoid migration migraines with the advice in this free guide. Download Free Guide Now!
Remy Porter